The Lumenary · Grades 3–5
Repetition and decisions
Name: ______________________
Date: ______________________
You will learn to
- Use a loop to shorten a sequence of repeated instructions, such as "repeat 4 times — forward, turn right 90°" for a square
- Write if–then–otherwise rules for sorting objects or playing a game, and explain why the order of the conditions can matter
- Follow a "repeat until" loop, predict when it stops, and spot a stopping condition that can never become true
- Explain the written method for column addition as a loop over the place values with a carry, and why the carry is never more than 1
- 1.
The loop repeat 5 times: forward, turn right, clap is written out in full, one instruction after another. How many instructions is that?
- 2.
Which program makes the turtle draw an equilateral triangle (three equal sides, ending where it started)?
- A.repeat 3 times: forward, turn right 120°
- B.repeat 3 times: forward, turn right 60°
- C.repeat 3 times: forward, turn right 90°
- D.repeat 4 times: forward, turn right 120°
- 3.
The program repeat 6 times: forward, turn right ☐ degrees draws a regular hexagon. What number goes in the box?
- 4.
Start at 5. Repeat: add 4, until the number is bigger than 30. How many times is "add 4" done?
- 5.
Which of these loops never stops?
- A.Start at 20. Repeat: take away 4, until the number is exactly 0.
- B.Start at 15. Repeat: take away 2, until the number is exactly 0.
- C.Start at 15. Repeat: take away 2, until the number is less than 1.
- D.Start at 0. Repeat: add 7, until the number is bigger than 50.
- 6.
In FizzBuzz (FizzBuzz for multiples of 3 and 5; otherwise Fizz for multiples of 3; otherwise Buzz for multiples of 5; otherwise the number), which numbers from 1 to 20 are said as "Fizz"? Write them separated by commas, like
{1, 2}. - 7.
Add 476 + 358 with the column method. How many times do you carry 1?
- 8.
When you add two numbers with the column method, why is the carry never 2?
- A.A column total is at most 9 + 9 + 1 = 19, which has only one ten.
- B.Because the rule says you may only carry 1.
- C.Because the numbers we add are always small.
- 9.
In Lean,
run home pis where the robot ends up after following programpfromhome, andrepeatBlock 4 [.forward, .turnRight]is the loop "repeat 4 times: forward, turn right". Which statement says that the square loop brings the robot home?- A.
run home (repeatBlock 4 [.forward, .turnRight]) = home - B.
(repeatBlock 4 [.forward, .turnRight]).length = 8 - C.
run home (repeatBlock 3 [.forward, .turnRight]) = home
- A.
- 10.
Write a function
fizzbuzz(n)that returns what a player says for the numbern:"FizzBuzz"for multiples of 3 and 5, otherwise"Fizz"for multiples of 3, otherwise"Buzz"for multiples of 5, otherwise the number as text (for example"7"). In Python,n % 3 == 0is the condition "nis a multiple of 3".Computational — Practice