Count-controlled iteration
I can use count-controlled iteration to repeat a sequence of commands a set number of times.
Count-controlled iteration
I can use count-controlled iteration to repeat a sequence of commands a set number of times.
Lesson details
Key learning points
- Iteration can be used to repeat sequences of commands in a program.
- Condition-controlled iteration will execute until a condition is met or is no longer met.
- Count-controlled iteration will execute a set number of times.
Keywords
Iteration - the process of repeating a sequence of instructions within a program loop
Count-controlled - a command that repeatedly runs a sequence of instructions a predefined number of times
Condition-controlled - a command that repeatedly runs a sequence of instructions until a condition is no longer being met
Common misconception
Iteration means a program will repeat something a set number of times.
Count-controlled iteration will repeat a sequence of commands a set number of times. Condition-controlled iteration will repeat a sequence of commands until a condition is met and so the number of times it will repeat can never be predicted.
Equipment
Pupils will need access to a device with block-based programming software. Examples in this lesson use Scratch https://oak.link/scratch
Licence
Prior knowledge starter quiz
6 Questions
Q1.What will be output when this program is executed?

Q2.What will be output when this program is executed?

Q3.Which conditions would evaluate as True with the following inputs?





Q4.=, < and > are all...
Q5.and, or and not are all...
Q6.Match the logic operator to the correct description.
True when both values are True
True when either or both values are True
True when the value is False
Assessment exit quiz
4 Questions
Q1.Match the keyword to the correct description.
repeatedly runs a sequence of instructions a set number of times
repeatedly runs a sequence of instructions until a condition is met
Q2.Iteration can make a program more , rather than having to have lots of duplicate blocks.
Q3.Which block is used in Scratch for iteration?



Q4.What will this code block do?
