Remember: A variable is a named box that holds a value until a block changes it. Set puts a value in, and change adds to it.
Read and answer
Read the story, then answer.
The box that said nineNoor held her basket under the apple tree, and plop, an apple dropped in. At Code Club she turned it into a game. She drew a basket and an apple that fell from the top of the stage. Ms. Ade said a game has to remember how many apples you catch, so Noor made a variable called apples and put a zero in it. Then she added a block: when the apple touches the basket, change apples by one. The box showed one, then two, then three. Teo played next and caught nine apples. When Noor pressed the flag for her own turn, the box said nine before she had caught a single apple! A variable keeps its value until a block changes it, and nobody had told the box to start again at zero. So Noor added set apples to zero, right under the flag block.
1
Which line puts the apples box back to zero?
line 4line 2line 3
2
The box apples holds 5. One change apples by 1 block runs. What does the box hold now?
165
3
The box apples holds 5. A set apples to 0 block runs. What does the box hold now?
056
4
A block puts a value into the box.
flagsetchange
5
A variable forgets its value by itself when a new game starts.
TrueFalse
6
Circle every thing on Noor's game screen that remembers a number.
📦the apples box🏁the flag💗the lives box🧺the basket🍎a falling apple
Match, order and fix
7
Join each block or word to its job.
1a variable
2set
3change
4the flag block
Aputs a value in the box
Badds to the value inside
Ca named box that holds a value
Dstarts the game
8
Put the steps of Noor's game in order.
Noor adds set apples to zero under the flag block
Noor makes a box called apples with a zero inside
Noor draws a basket and a falling apple
Teo plays and catches nine apples
Noor adds: change apples by one when the apple touches the basket
9
Noor presses the flag for her turn, and the box already says 9. What is the mix-up to fix?
The basket is too smallNothing told the box to start again at zeroThe apple falls too slowly
10
Noor's game also has a box called lives. Which block puts 3 into it at the start?
change lives by 1set lives to 3when flag clicked
11
The stack now starts with set apples to 0. Noor catches 2 apples. What does the box say at the end?
1192
12
Write the name of one more thing a game could count in a box.
13
Draw the apples box after Teo caught nine apples.
Scan the code at the top to mark this sheet on screenTake a photo of your answers or type them. It is marked for you automatically, and your score is kept.