Algorithms and Flow Charts
Algorithms and Flow Charts
charts
What is Problem solving
• A process of finding solution to a given problem
Steps of Problem Solving
Identify the
problem
Brainstorm
Evaluate
solutions
Select the
Implement
best idea
What is an Algorithm
• A plan or sequence of instructions followed in a specific order to
complete a task or solve a problem.
• It can be used to solve a wide range of problems such a finding the
shortest route,sorting data or encrypting information.
• Algorithms follow the same basic structure of breaking down a task
in smaller steps.
What is your morning routine on a
school day
What is a computer program?
• An algorithm that tells the computer specific steps to execute , in a
specific order, in order to carry out a specific task.
Flow charts
• Help programmers to plan and write programs.
• Visual representation of an algorithm.
Flowchart Symbols
Wait
Add milk
and sugar
What do you notice that is different
about this symbol and its arrows, Stop
Is lamp No
plugged Plug in Lamp
in?
yes
Is bulb
yes
burned
out ? Replabe bulb
no
Repair lamp
stop
What is a condition?
• Something that must happen in order for some thing else to be
possible.
• In programming terms we say a condition is true or not true
• Checking wether a condition is true or not trueis called testing the
condition.
Questions
• What is problem solving? Write the steps of problem solving.
• What is an Algorithm?
• What is a computer program?
• What is a flowchart?
• Draw flow chart symbols and explain their meaning
What does a computer use when it
needs to make a descion
• IF<condition>THEN<task 1>ELSE<task 2>
Activity 2
• On Thonny design a program asking user for an input of time store it
in variable x if time is ==9 print welcome to the party else print sorry
you are late.
• Write the correct code in your note books
• x=input('enter the time :')
• if x=='9':
• print('welcome to the party')
• else:
• print('Sorry you are late ')