Counting and asking
Answers are for parents and teachers.
1
Write an algorithm for a program that counts a runner’s laps. The variable starts at 0, goes up by 1 for each lap, and the program says ‘Done!’ when the count is exactly 3.
Set laps to 0 at the flag. At each lap key press: change laps by 1; if laps = 3 then say Done!.
2
Make a table with the columns Input, Process and Output for a program that asks how many apples you want to buy at 2 coins each and says the cost. Fill in three rows.
For example: 3 gives 6; 5 gives 10; 10 gives 20.
3
A user types 8 into the sticker program (3 coins each). What does the sprite say? Show your sum.
8 × 3 = 24, so it says ‘Cost: 24’.
4
Write two sentences to explain to a grown-up what a bug is and one way to find it.
A bug is a mistake in a program. One way to find it is to compare the code with the algorithm step by step, or to trace the program.
5
(if you have a computer or tablet) Build the Baker program with ‘loaves = 5’. Press the space key 7 times. Does it say ‘Tray full!’ when you expected?
It speaks once, at the fifth press.