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 | |
|---|---|---|
| 1if score > 89 then say A else (if score > 69 then say B else say C) | Aif score > 89 then A else (if score > 69 then B else C) | |
| 2else (if score > 49 then say Pass else say Try again) | Bif score > 89 then say A else (if score > 69 then say B else say C) | |
| 3The order of checks matters: check the highest score band first so a score of 95 gets an A and not a B. | CThe second if block is placed after the else block instead of inside the else part, so there is no real third choice and the program can't choose properly between three alternatives. | |
| 4A nested if-else is the same as the algorithm's ELSE IF: IF score > 89 THEN A, ELSE IF score > 69 THEN B, ELSE C. | DAn if-else block sits inside the else part of another if-else block, so the program can choose between three results: A, B or C. | |
| 5if score > 69 then say B else (if score > 89 then say A else say C) | EIf the first check fails, the program moves on to this next check and picks one of two new answers. | |
| 6if score > 89 then say A else say B (if score > 69 then say C) | FThe checks are in the wrong order. A score of 95 is more than 69, so it says B and never reaches the check for A. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
nested if-else — An if-else block placed inside the else part of another if-else block. The program checks one condition at a time, in order, so it can choose between three or more alternatives.if score > 79 then say("A") else
if score > 49 then say("B") else
say("C")if score > 79 then say("A") else
if score > 49 then say("B") else
say("C")if score > 79 then say("A") else
if score > 49 then say("B") else
say("C")if score > 79 then say("A") else
if score > 49 then say("B") else
say("C")if score > 79 then say("A") else
if score > 49 then say("B") else
say("C")