Starter quiz
- What will be output when this program is executed?
- Good afternoon
- How are you?
- Good afternoon How are you? ✓
- Nothing will be output.
-
- What will be output when this program is executed?
- Good afternoon How are you? ✓
- How are you?
- Good morning Good afternoon How are you?
- Good morning How are you?
-
- Which conditions would evaluate as True with the following inputs?
- number1 > 20 or number2 < 100 ✓
- number1 > 20 and number2 < 100 ✓
- number1 > 30 or number2 < 90
- number1 > 30 and number2 < 91
- =, < and > are all...
- comparison operators. ✓
- logic operators.
- conditions.
- variables.
-
- and, or and not are all...
- logic operators. ✓
- comparison operators.
- conditions.
- variables.
-
- Match the logic operator to the correct description.
- and⇔True when both values are True ✓
- or⇔True when either or both values are True ✓
- not⇔True when the value is False ✓
Exit quiz
- Match the keyword to the correct description.
- count-controlled⇔repeatedly runs a sequence of instructions a set number of times ✓
- condition-controlled⇔repeatedly runs a sequence of instructions until a condition is met ✓
- Iteration can make a program more ______, rather than having to have lots of duplicate blocks.
- 'efficient' ✓
- Which block is used in Scratch for iteration?
- What will this code block do?
- 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.
-
Worksheet
Loading worksheet ...
Presentation
Loading presentation ...
Video
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.
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.
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
+