Teaching Notes 4 Asal It
Teaching Notes 4 Asal It
4 Algorithms
and flowcharts
Unit plan
Session Outline of lesson content Resources
4.1 Input, output, processes Be able to read, correct and Worksheet 4.1 Fill in the gaps
write algorithms using input, Worksheet 4.2 Trace the algorithm
output and processes.
Coursebook questions 1–8
Coursebook Practical Activity 4.01–4.03
Coursebook exam-style questions 1–3
Workbook Tasks 4.1–4.2
4.2 Conditional branching Be able to read, correct Conditional branching presentation
and write algorithms using Coursebook questions 9–13
conditional branching.
Coursebook Practical Activity 4.04
Workbook Tasks 1.4, 1.7
4.3 Looping Be able to read, correct Worksheet 4.3 Write a loop
and write algorithms Coursebook questions 14–19
using looping.
Coursebook Practical Activity 4.05–4.07
Coursebook exam-style questions 4, 5, 7
Workbook Tasks 1.3, 1.5, 1.6, 1.9,
1.10, 1.11
4.4 Procedures / Be able to read, correct Worksheet 4.4 People subroutines
subroutines and write algorithms using Coursebook questions 20–25
subroutines.
Coursebook Practical activities 4.08-4.10
Coursebook exam-style questions 6, 8
Workbook Task 1.8
BACKGROUND KNOWLEDGE
• Learners may have some experience of reading or identifying algorithms, most likely as
flowcharts or algorithms.
• Learners may have encountered control through the use of robotics, for example, making a turtle
move around an area.
KEY WORDS
Common misconceptions
Misconception How to elicit How to overcome
Statements to add to variables Ask learners to create programs Show example programs and
can be written as var + 1 instead that require this type of process. remind learners about how to
of var = var + 1 do it when they are creating
algorithms.
The difference between string Ask learners to create programs Show example programs
and identifiers, i.e. use of that require string and and remind learners about
speech marks. variable outputs. the difference when they are
creating algorithms.
Lesson starters
1 Follow the flowchart (10 min)
Learning intention: To follow an algorithm.
Preparation: Create a presentation slide with a list of instructions for learners to follow; e.g. a series of
actions to perform (stand up, turn around, sit down, clap your hands, etc.)
Description: Learners have to follow the instructions. These could tell them to do something such as log
onto the computers, or write something, or sing a song, etc. but there needs to be a series of instructions
that follow one after the other. Repeat this using pseudocode in place of flowcharts.
What to look out for: Learners jumping steps in the algorithm.
Main activities
1 Reverse a program (20 min)
Learning intention: To create a flowchart.
What this activity is good for: Practising the creation of flowcharts, following algorithms.
Preparation: Prepare an algorithm written in a programming language, or possibly in software such
as Scratch.
Description: Give learners a short computer program written in code, and ask them to reverse engineer a
flowchart from the program. Repeat this using pseudocode in place of flowcharts.
Differentiation ideas: To support learners, provide them with a structure for the flowchart with some
elements completed, and gaps for them to complete.
To challenge confident learners, ask them to then extend the algorithm to perform additional functions.
Differentiation ideas: To support learners, provide them with instructions on how to use Scratch, provide
further descriptions of the program required by breaking it down further.
To challenge confident learners, ask them to explore further functions in the software to add
additional features.
Plenary ideas
1 Spot the error (10 min)
Preparation: Provide an example program with error within.
Description: Show learners a description of an algorithm and a flow chart or algorithm for it that
includes at least one error. Ask learners to test the algorithm to find the error and suggest the correction.
Repeat this using pseudocode in place of flowcharts.
Homework idea
Give learners a description of a program to create an algorithm for; this could be a flowchart of a program such
as on Scratch.
Assessment idea
Learners can be asked to create algorithms, edit an algorithm to make it perform a different task, follow
an algorithm and either state the output or complete a trace table, and identify where there are errors in an
algorithm and correct these errors.
• Understand the purpose of and • Trace an algorithm that uses conditional branching.
function of conditional branching.
• Write an algorithm that uses conditional branching.
• Draw a flowchart that makes use of conditional
branching.
• Correct an algorithm that uses conditional branching.
KEY WORDS
Common misconceptions
Misconception How to elicit How to overcome
When using multiple conditions Ask learners to trace algorithms Run through the algorithms with
learners may confuse incorporating multiple learners. Show them the rules
AND and OR. comparisons. for when one side or both is
true, etc.
Learners often confuse < with > Ask learners to trace algorithms, Repeatedly show learners which
and write algorithms using the part of the symbol is the smallest
comparisons. and which is the largest.
Lesson starters
1 Follow the algorithm (10 min)
Learning intention: To understand and follow conditional statements.
Preparation: Prepare a pseudocode program written using IFs.
Description: Ask learners to follow the algorithm, this should include an IF statement, for example, on age,
height, etc. to distinguish between learners and tell them to perform different actions, for example, some
learners may be told to stand up, others may be told to sit on the floor.
Main activities
1 Card selection (15 min)
Learning intention: To understand how conditional branching works.
What this activity is good for: Practical application of theory.
Resources: A deck of playing cards, conditional_branching.ppt
Description: Ask each learner to take one card from the pack. Show learners the first slide and ask them
to follow the instructions based on their card. Repeat, giving learners a new card each time, for each
algorithm.
Plenary ideas
1 Correct the algorithm (10 min)
Preparation: Prepare a pseudocode algorithm including conditional statement with at least one error in it.
Description: Give learners a description of what a pseudocode algorithm should do and an example
flowchart. Ask learners to find the error(s) and suggest corrections.
Homework ideas
Give learners a description of a program for them to create an algorithm for.
Ask learners to create an A5 guide to algorithms including the basics and conditional branching.
Assessment idea
Include questions asking learners to follow algorithms with conditional branching to work out the output.
Questions can include finding errors in an algorithm and correcting them, as well as completing an algorithm
and creating an algorithm from a description.
4.3 Looping
LEARNING INTENTIONS
KEY WORDS
condition-controlled loop: a loop that runs based on a condition, not the number of times it will run
count-controlled loop: a loop where you know the number of times it will run
FOR loop: a count-controlled loop
iteration: to repeat; a loop in code
loop: code that is repeated
WHILE loop: a condition-controlled loop that runs while the condition is true
Common misconceptions
Misconception How to elicit How to overcome
Learners may think that a loop Ask learners to trace algorithms Show learners how to run the
stops as soon as the stopping with loop conditions. algorithm line by line and when
condition is met, instead of the condition is checked.
running the rest of the code in
the loop and then checking the
condition.
Lesson starters
1 Follow the algorithm (10 min)
Learning intention: To understand the function of looping.
Preparation: Use an example of an algorithm that includes a loop and physical actions for learners
to perform.
Description: Ask learners to trace the algorithm and perform the actions that it tells them to.
Main activities
1 Write a loop (15 min)
Learning intention: To understand how repeated code can be written as a loop.
What this activity is good for: Practical application of theory, algorithmic thinking.
Resources: Worksheet 4.3 Write a loop.
Description: Give learners an algorithm with a set number of repeated statements, e.g. Worksheet 4.3
Write a loop. Ask learners to rewrite the algorithm using a loop.
Differentiation ideas: To support learners, give them questions to prompt their algorithm development, e.g.
finding out how many times the data repeats.
To challenge confident learners, provide more complex algorithms where the iteration is harder to identify
and successfully convert.
Plenary ideas
1 Convert the algorithm (10 min)
Description: Ask learners to convert a flowchart into pseudocode, or pseudocode into a flowchart.
Homework ideas
Give learners a description of a program that needs a loop and ask learners to write an algorithm for
the problem.
Ask learners to record any examples of real-life looping that they see or experience and bring them to share at
the next lesson.
Assessment ideas
Give learners questions that ask them to write programs that require loops.
You could also give learners programs that do not use loops, and ask them to implement them with loops.
KEY WORDS
Common misconceptions
Misconception How to elicit How to overcome
The main algorithm continues Ask learners to trace Show learners how the algorithm
running at the same time as the algorithms. runs line by line and use diagrams
subroutines. to show the algorithm’s focus to
the subroutine and then back.
Lesson starters
1 Find the place for the subroutine call (10 min)
Learning intention: To understand how to call subroutines.
Preparation: Supply an example algorithm where the subroutine call is missing.
Description: Ask learners to work out where the subroutine call should go.
Main activities
1 Convert a program into a subroutine (30+ min)
Learning intention: To understand how a program can be split into subroutines.
What this activity is good for: Practical implementation of theory.
Preparation: Supply an example of an algorithm that can be split into subroutines.
Description: Give learners an algorithm with several different sections that can be put into different
subroutines. Tell the learners what the subroutines should do and ask them to re-write the program using
subroutines.
Differentiation ideas: To support learners give them the lines of code that need to be put into each
subroutine and give them a structure to write their response within.
To challenge confident learners ask them to identify if any further elements could be split into subroutines.
Plenary idea
1 Complete the algorithm (10 min)
Preparation: Provide an example algorithm with missing statements.
Description: Ask learners to complete the algorithm by working out what the missing statements are.
Homework idea
Give learners a description of a program that requires subroutines and ask them to create an algorithm for the
program: this could be on paper or using software such as Scratch.
Assessment ideas
Give learners algorithms and ask them to identify appropriate sections that could be written as subroutines.
Ask learners to add subroutines to an algorithm.
Ask learners to follow an algorithm that uses subroutines.