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 | |
|---|---|---|
| 1Mark >= 0 AND Mark <= 100 | AReverses the BOOLEAN value: TRUE when GameOver is FALSE, FALSE when GameOver is TRUE | |
| 2NOT GameOver | BTRUE only when Mark is at least 0 and also at most 100, so it checks a valid range | |
| 3OR is TRUE when at least one condition is TRUE, so it can detect a value outside a range | CAnswer < 0 OR Answer > 100 | |
| 4Brackets make a complex condition clear by showing which part is worked out first | DAND is the wrong operator. No Mark can be below 0 and above 100 at the same time, so the condition is never TRUE. It should use OR. | |
| 5IF Mark < 0 AND Mark > 100 THEN | EOR is the wrong operator for a valid range. Every number is at least 0 or at most 100, so the condition is always TRUE. It should use AND. | |
| 6IF Mark >= 0 OR Mark <= 100 THEN | F(Age >= 13 AND Age <= 19) OR Student = TRUE |
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 — AND is TRUE only when both conditions are TRUE. OR is TRUE when at least one is TRUE. NOT reverses a BOOLEAN value. Use brackets to make complex conditions clear.IF Mark >= 0 AND Mark <= 100 THEN
OUTPUT "Valid mark"
ENDIFIF Answer < 0 OR Answer > 100 THEN
OUTPUT "Out of range"
ENDIFWHILE NOT GameOver DO
OUTPUT "Keep playing"
ENDWHILEIF NOT (Mark >= 0 AND Mark <= 100) THEN
OUTPUT "Invalid"
ENDIFIF Age >= 18 AND (HasId OR HasPass) THEN
OUTPUT "Entry allowed"
ENDIF