Flowcharts
Flowcharts
Y10-01-CT5: Flowcharts
Learning objectives
In this lesson you will learn to:
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-01-CT5: Flowcharts
Algorithms
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-01-CT5: Flowcharts
Flowcharts
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-01-CT5: Flowcharts
Symbols
These are the symbols that you will need to be able to use in your
flowcharts.
These are not the only symbols you will use, but we’ll introduce the
rest later.
input
start process
output
This is the This is the process This is the data The arrow is
terminator symbol. It is for any symbol. It is used to join
symbol. It action that needs to used any time symbols
goes at the be carried out such you need to together. The
beginning and as a calculation or take an input arrow shows
the end of a variable or output a the flow of
flowchart. declaration. value. the algorithm.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-01-CT5: Flowcharts
An example
start
width =
height = int(input("Enter height: ")) user input
width = int(input("Enter width : "))
area = height * width
print("The area is", area) area = height *
width
output
area
end
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-01-CT5: Flowcharts
Using a flowchart
You are not usually going to turn Python code into a flowchart.
Most often you will do the opposite – turn a flowchart into Python code.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-01-CT5: Flowcharts
Worked example
Here is the written description of an algorithm.
• set PI to 3.141
• ask the user to enter the radius of a circle
• calculate the area of the circle (PI * r * r)
• output the area with a suitable message.
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-01-CT5: Flowcharts
Runtime errors
This is a process (declaring a constant, start
Set PI to 3.141
whose value should not change)
set PI to
3.141
Ask the user to enter the
This is an input
radius of a circle radius =
user input
output
area
Output the area with a This is an output
suitable message. end
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.
Y10-01-CT5: Flowcharts
© Pearson Education Ltd 2020. Copying permitted for purchasing institution only.