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 | |
|---|---|---|
| 1Age >= 0 AND Age <= 120 | AReverses the condition: true when Score is anything except 50 | |
| 2NOT (Score = 50) | BAND is used where OR is needed. No number can be below 0 and above 100 at the same time, so the condition is never true. It should be Answer < 0 OR Answer > 100. | |
| 3OR is true when at least one condition is true, so it can catch a value outside a range | C(Age < 13 OR Age > 19) AND Member = TRUE | |
| 4Brackets make clear which conditions are combined first in a complex condition | DOR is used where AND is needed. Every number is at least 0 or at most 120, so invalid ages like -5 or 200 still pass. It should be Age >= 0 AND Age <= 120. | |
| 5IF Age >= 0 OR Age <= 120 THEN | EAnswer < 0 OR Answer > 100 | |
| 6IF Answer < 0 AND Answer > 100 THEN | FTrue only when both conditions are true, so the age is inside the valid range 0 to 120 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
AND OR NOT — Logical operators that combine BOOLEAN conditions: AND needs both true, OR needs at least one true, NOT reverses a condition. Use brackets in complex ones, e.g. Age >= 0 AND Age <= 120.IF Age >= 0 AND Age <= 120 THEN
OUTPUT "Age accepted"
ENDIFIF Answer < 0 OR Answer > 100 THEN
OUTPUT "Out of range"
ENDIFIF NOT (Age >= 18) THEN
OUTPUT "Under 18"
ENDIFWHILE NOT (Answer >= 0 AND Answer <= 100) DO
INPUT Answer
ENDWHILEValid ← (Age >= 0) AND (Age <= 120)
OUTPUT Valid