Lesson/week 3:
Flowcharts
KS4 - Programming
Starter activity
Think, write, pair, share
This is a flowchart. A flowchart can be Start welcome
used to visually represent an algorithm or
program.
Output “Hello
Question . welcome
world!”
What do you think will happen when this
flowchart is executed as a program?
End End
Starter activity
Think, write, pair, share
The code will output “Hello world!” on Main welcome
the screen for the user.
Output “Hello
welcome
world!”
End End
Hello world!
Objectives
Lesson 3: Flowcharts
In this lesson, you will:
● Identify flowchart symbols and describe how to use them (start, end, input, output,
subroutine)
● Translate a flowchart into a program sequence
● Design a flowchart for a program
4
Activity 1
Flowcharts representing code
Flowcharts are used when designing Start welcome
programs.
They should be clear and precise, just Output “Hello
like your code. welcome world!”
Flowcharts are read from top to bottom.
End End
Activity 1
Flowcharts representing code
1 def welcome(): Start welcome
2 print("Hello world")
3
4 welcome()
Output “Hello
welcome
world!”
Start will be executed first as it is the
main program.
End End
Terminators (oval shapes) are used to
show the start and end of the program or
subroutines.
Activity 1
Flowcharts representing code
1 def welcome(): Start welcome
2 print("Hello world")
3
4 welcome()
Output “Hello
welcome
world!”
Arrows are used to show the flow of the
End End
program.
The arrow heads represent the direction
of the flow.
Activity 1
Flowcharts representing code
1 def welcome(): Start welcome
2 print("Hello world")
3
4 welcome()
Output “Hello
welcome
world!”
Welcome is referring to a subroutine call.
End End
A subroutine call is represented by a
rectangle with two lines at each side.
Activity 1
Flowcharts representing code
1 def welcome(): Start welcome
2 print("Hello world")
3
4 welcome()
Output “Hello
welcome
world!”
The subroutine is then executed.
End End
Activity 1
Flowcharts representing code
1 def welcome(): Start welcome
2 print("Hello world")
3
4 welcome()
Output “Hello
welcome
world!”
Subroutines are created in separate
End End
flowcharts that are linked via name and
symbol.
Activity 1
Flowcharts representing code
1 def welcome(): Start welcome
2 print("Hello world")
3
4 welcome()
Output “Hello
welcome
world!”
An output is represented using a
End End
parallelogram. This symbol is also used
for inputs.
Hello world!
Activity 1
Flowcharts representing code
1 def welcome(): Start welcome
2 print("Hello world")
3
4 welcome()
Output “Hello
welcome
world!”
At the end of the subroutine it will return
End End
to the main program. The same thing
happens with your flowcharts.
Hello world!
Activity 1
Flowcharts representing code
1 def welcome(): Start welcome
2 print("Hello world")
3
4 welcome()
Output “Hello
welcome
world!”
The main program will then resume.
End End
Or in this case, end.
Activity 1
Flowcharts representing code
Start Output “Hello
Terminators are used for world!”
Input name
the start and end of subroutines or
programs. An input or output is represented by a
parallelogram.
Arrows are used to show
the direction and flow of the program.
Subroutines are
There are many more symbols that can be used
represented by a rectangle with two lines
with flowcharts, which will be introduced in the
welcome
either side. coming lessons.
Activity 2
Use a flowchart to write a program
For the next activity you will be doing
some pair programming.
This is where you work in pairs and each
member is assigned a role of either the
driver or the navigator.
The driver’s role is to control the
keyboard and mouse, and type the code
into the correct places.
Activity 2
Use a flowchart to write a program
The navigator’s role is to help the driver
by watching for any mistakes, reading the
instructions to the driver, and seeking
support if needed.
Both partners must contribute equally.
There will be opportunities to swap roles
throughout the activity.
Activity 2
Use a flowchart to write a program
Use the ‘Translate a flowchart to write a
program’ to help guide you through the
pair programming activity.
Switch driver and navigator roles every
five minutes.
Activity 3
Design a flowchart
After a demonstration of the software,
begin designing a flowchart for a maths
mind-reading trick.
Find the instructions in the ‘Design a
flowchart’ handout.
Plenary
What are these symbols used for?
Plenary
What are these symbols used for?
Terminator: To symbolise the start and
end.
Subroutine call: To symbolise a change
of flow in execution to a subroutine.
Input/Output: To symbolise data being
input or displayed for the user.
Next lesson
Next lesson, you will…
Learn how to use variables appropriately
in your programs
21