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 | |
|---|---|---|
| 1REPEAT UNTIL guess = secret | AIF guess < secret THEN SAY "Too low" | |
| 2IF guess > secret THEN SAY "Too high" | BKeep asking for guesses again and again until the guess matches the secret number. | |
| 3Count every guess by adding 1 to the counter each time round the loop. | CThe loop stops when the guess is too high, not when it is correct. It should be REPEAT UNTIL guess = secret. | |
| 4The decision for a wrong guess that is smaller than the secret number gives a 'too low' clue. | Dcount ← count + 1 | |
| 5REPEAT UNTIL guess > secret | EThe counter is reset to 0 on every go round the loop, so it never counts above 1. Set count to 0 once before the loop starts. | |
| 6SET count ← 0 (placed inside the loop) | FIf the guess is bigger than the secret number, tell the player the guess is too high. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
REPEAT UNTIL guess = secret — The guessing game loop: keep asking for a guess until it matches the secret number. Inside, decide too high, too low or correct, and add 1 to the count each time.SET secret ← 7
SET count ← 0
REPEAT UNTIL guess = secretREPEAT UNTIL guess = secret
INPUT guess
SET count ← count + 1IF guess < secret THEN
OUTPUT "Too low"INPUT guess
SET count ← count + 1IF guess = secret THEN
OUTPUT "Correct! Guesses: ", count