Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1score > 10 | AReports true when the lives variable is less than 3, otherwise false | |
| 2lives < 3 | Btimer > 30 | |
| 3An equals block is true only when both values are exactly the same | Canswer = 7 | |
| 4Comparing a variable to a number to see if it is bigger than the number | DUsing < 0 means less than 0, which is never true for lives that stop at 0. Use lives = 0 to check for no lives. | |
| 5if score > 10 then say 'Win' (checking for exactly 10 using >) | EUsing > when you want to check for exactly 10. The > block is false when the score is 10. Use = instead. | |
| 6lives < 0 (to check the player has no lives left) | FReports true when the score variable is greater than 10, otherwise false |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
score > 10 — A comparison block checks two values and reports true or false. This one is true when the score variable is greater than 10. Use < for less than and = for equal to.if <score > 10> thenif <lives < 3> then
say (Careful!) for 2 secondsif <answer = 7> then
say (Correct!) for 2 secondsset score to 12
if <score > 10> then
say (You win!) for 2 secondsset score to 8
<score < 10> reports true