Algorithms: Sequences and Loops
Questions 10
The answer key is shown to signed-in teachers.
-
Order of instructions
A robot must draw a square. Which order of block commands will make the robot draw a square correctly?
Move forward, move forward, move forward, move forward, turn right, turn right, turn right, turn right
Turn right, turn right, move forward, move forward, move forward, move forward, turn right, turn right
Turn right, move forward, turn right, move forward, turn right, move forward
Move forward, turn right, move forward, turn right, move forward, turn right, move forward, turn right
Think about what the robot does after each side: it must move a side and then change direction before the next side. -
Purpose of a repeat block
What is the main purpose of a 'repeat 4 times' block in block coding?
To make the program start over from the beginning forever
To run the blocks inside it a set number of times without copying them
To change the color of the sprite
To delete the blocks that come after it
Imagine you want to clap three times. Would you need to write the clap block three times, or is there a shorter way? -
-
Sequence matters
A character needs to pick up a ball and then throw it. Which sequence is correct?
Throw the ball, then throw the ball again, then pick up the ball
Throw the ball, then pick up the ball
Pick up the ball, then throw the ball
Pick up the ball and throw the ball at the same time, then pick it up
You cannot throw something you do not yet hold. Which action has to happen first? -
Repeat until a condition
A program uses a 'repeat until touching the wall' block. What happens when the sprite touches the wall?
The repeat loop stops and the next block after the loop runs
The loop starts again from the beginning
The computer turns off
The sprite is deleted and the program restarts
The word 'until' tells you the loop keeps going only while something is not yet true. -
Loop with a forever block
What does a 'forever' block do when it contains the block 'say Hello'?
It removes the word Hello from the screen
It says Hello again and again without stopping until the program is stopped
It says Hello exactly ten times and then stops
It says Hello once and then stops the program
The word 'forever' describes how long the blocks inside will keep running. -
Debugging a sequence
A student wants a sprite to walk to a flower and then wave. The student put the 'wave' block first and the 'walk to flower' block second. What is the best fix?
Change the sprite's color
Add a repeat block around the wave block only
Delete the wave block
Swap the two blocks so that walking comes first and waving comes second
Read the program from top to bottom, as the computer does, and compare the order with what the student wanted. -
-
-
About
- Subjects
- Computers
- Audience
- Elementary School · Grades 2–3
- Difficulty
- 3 out of 10
- Language
- English
- Who can see it
- Everyone
- Written by AI
- Claude Haiku 5.5
- Created
Comments