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 Age >= 13 AND Age <= 19 THEN | AIF Day = "Sat" OR Day = "Sun" THEN | |
| 2IF NOT (Score > 50) THEN | BTrue only when both conditions are true, so Age is in the range 13 to 19 | |
| 3OR needs only one condition to be true, so a Day of Saturday or Sunday passes | COR is used instead of AND, so the test is true for every number. A range test needs both conditions true, so use AND. | |
| 4A range test checks that Number is at least 1 and at most 10 by joining two comparisons with AND | DIF Number >= 1 AND Number <= 10 THEN | |
| 5IF Number >= 1 OR Number <= 10 THEN | EThe second condition is incomplete because Age is missing after AND. Each side of AND must be a full condition: Age <= 19. | |
| 6IF Age >= 13 AND <= 19 THEN | FReverses the condition, so it is true when Score is 50 or less |
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 — Logic operators that combine or reverse conditions: AND needs both true, OR needs one true, NOT reverses a condition. Range test: Number >= 1 AND Number <= 10IF Number >= 1 AND Number <= 10 THEN
OUTPUT "Valid"
ENDIFIF Answer = "Y" OR Answer = "y" THEN
OUTPUT "Yes"
ENDIFIF NOT Found THEN
OUTPUT "Not found"
ENDIFIF Number >= 1 AND Number <= 10 THEN
OUTPUT "In range"
ENDIFIF Score < 0 OR Score > 100 THEN
OUTPUT "Invalid"
ENDIF