New
New
Year 7

Count-controlled iteration

I can use count-controlled iteration to repeat a sequence of commands a set number of times.

Link copied to clipboard

New
New
Year 7

Count-controlled iteration

I can use count-controlled iteration to repeat a sequence of commands a set number of times.

Link copied to clipboard

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

These resources were created for remote use during the pandemic and are not designed for classroom teaching.

Lesson details

Key learning points

  1. Iteration can be used to repeat sequences of commands in a program.
  2. Condition-controlled iteration will execute until a condition is met or is no longer met.
  3. Count-controlled iteration will execute a set number of times.

Keywords

  • Iteration - the process of repeating a sequence of instructions.

  • 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.


To help you plan your year 7 computing lesson on: Count-controlled iteration, download all teaching resources for free and adapt to suit your pupils' needs...

The solution for Task B requires a variable to be decreased by 1 each time the loop is executed. Explore this with pupils by using a number of props in a container and providing a visualisation of removing an item during each iteration.
Teacher tip

Equipment

All pupils require access to devices that have or can access the online version of Scratch. Starter programs are linked to the lesson and can be remixed as required.

Licence

This content is © Oak National Academy Limited (2025), licensed on Open Government Licence version 3.0 except where otherwise stated. See Oak's terms & conditions (Collection 2).

Lesson video

Loading...

6 Questions

Q1.
What will be output when this program is executed?
An image in a quiz
Good afternoon
How are you?
Correct answer: Good afternoon How are you?
Nothing will be output.
Q2.
What will be output when this program is executed?
An image in a quiz
Correct answer: Good afternoon How are you?
How are you?
Good morning Good afternoon How are you?
Good morning How are you?
Q3.
Which conditions would evaluate as True with the following inputs?
An image in a quiz
Correct answer: number1 > 20 or number2 < 100
Correct answer: number1 > 20 and number2 < 100
number1 > 30 or number2 < 90
number1 > 30 and number2 < 91
Q4.
=, < and > are all...
Correct answer: comparison operators.
logic operators.
conditions.
variables.
Q5.
and, or and not are all...
Correct answer: logic operators.
comparison operators.
conditions.
variables.
Q6.
Match the logic operator to the correct description.
Correct Answer:and,True when both values are True

True when both values are True

Correct Answer:or,True when either or both values are True

True when either or both values are True

Correct Answer:not,True when the value is False

True when the value is False

Q1 Scratch Foundation under CC BY-SA 2.0 Q2 Scratch Foundation under CC BY-SA 2.0 Q3 Scratch Foundation under CC BY-SA 2.0 Q3 image 1 Scratch Foundation under CC BY-SA 2.0 Q3 image 2 Scratch Foundation under CC BY-SA 2.0 Q3 image 3 Scratch Foundation under CC BY-SA 2.0 Q3 image 4 Scratch Foundation under CC BY-SA 2.0

4 Questions

Q1.
Match the keyword to the correct description.
Correct Answer:count-controlled,repeatedly runs a sequence of instructions a set number of times

repeatedly runs a sequence of instructions a set number of times

Correct Answer:condition-controlled,repeatedly runs a sequence of instructions until a condition is met

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.
Correct Answer: efficient
Q3.
Which block is used in Scratch for iteration?
Correct Answer: An image in a quiz
An image in a quiz
An image in a quiz
An image in a quiz
Q4.
What will this code block do?
An image in a quiz
Correct answer: It reduces the value of life each time the repeat block executes.
It increases the value of life each time the repeat block executes.
It sets the value of life to -1.
Q3 image 1 Scratch Foundation under CC BY-SA 2.0 Q3 image 2 Scratch Foundation under CC BY-SA 2.0 Q3 image 3 Scratch Foundation under CC BY-SA 2.0 Q4 Scratch Foundation under CC BY-SA 2.0