Year 7
Lesson details
Key learning points
- In this lesson, we will take a look at all of the types of loops that you can use in Scratch. We will learn how to evaluate which loop to choose for each problem that we want to solve.
Licence
This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.
Loading...
3 Questions
Q1.
A learner has created the following piece of code to check if a password is correct or not. They want to improve it so that it will only give a maximum of three attempts before locking them out of the game for 60 seconds. What programming construct should they use for this? (Source: Scratchblocks)
A Forever loop
A Repeat 3 loop
Three If/else statements
Q2.
A learner has created the following block of code, when will the loop terminate? (Source: Scratchblocks)
When ‘number’ holds the value ‘3’
When ‘number’ holds the value ‘4’
When ‘number’ is higher than ‘3’
Q3.
What will be the output of this program when it is executed? What will the sprite say? - (Source: Scratchblocks)
1, 2, 3, 4
1, 2, 3, 4, 5
Nothing
3 Questions
Q1.
What does this block of code do? (Source: Scratchblocks)
Counts to three and then moves on to the next block
Picks a random number between 1 and 3
Waits for 3 seconds
Q2.
Which type of loop should you use in Scratch if you want to repeat some instructions for a set amount of times?
Forever loop
Repeat until loop
Q3.
All of the blocks of code below will execute a countdown timer. Select the most appropriate block for this purpose when using Scratch. (Source: Scratchblocks)
A
B
D