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 | |
|---|---|---|
| 1UNTIL Guess = Secret OR Tries = 5 | AREPEAT INPUT Mark UNTIL Mark >= 0 AND Mark <= 100 | |
| 2UNTIL Mark >= 0 AND Mark <= 100 | BStop repeating as soon as the guess is correct or the player has used 5 tries, whichever happens first. | |
| 3A guessing game that must stop when the guess is right or the tries have run out | CAND is used instead of OR. The loop only stops if the guess is correct and the fifth try is used at the same time, so a correct guess on try 2 does not end it. | |
| 4Keep asking for a mark until it is inside the valid range of 0 to 100 | DStop repeating only when the mark is both at least 0 and at most 100, so the input is valid. | |
| 5UNTIL Guess = Secret AND Tries = 5 | EREPEAT INPUT Guess Tries ← Tries + 1 UNTIL Guess = Secret OR Tries = 5 | |
| 6UNTIL Mark >= 0 OR Mark <= 100 | FOR is used instead of AND. Every number is at least 0 or at most 100, so the condition is always TRUE and invalid marks like 150 or -5 are accepted. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
UNTIL Guess = Secret OR Tries = 5 — A REPEAT loop whose UNTIL condition uses OR stops as soon as either part becomes TRUE, so the loop has two ways to end: a correct guess or running out of tries.REPEAT
INPUT Guess
UNTIL Guess = Secret OR Tries = 5REPEAT
INPUT Guess
UNTIL Guess = Secret OR Tries = 5REPEAT
Tries ← Tries + 1
UNTIL Guess = Secret OR Tries = 5REPEAT
INPUT Mark
UNTIL Mark >= 0 AND Mark <= 100REPEAT
INPUT Mark
UNTIL Mark >= 0 AND Mark <= 100