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 | |
|---|---|---|
| 1Average ← (A + B) / 2 | AResult ← A + B / 2 | |
| 2IF (Age > 12) AND (Age < 20) OR (Member = TRUE) THEN | BAverage ← (Mark1 + Mark2 + Mark3) / 3 | |
| 3Without brackets, division is done before addition, so only B is divided by 2 | CWithout brackets, AND is worked out before OR, so the condition may not mean what was intended. Brackets are needed, such as (Age < 12 OR Age > 65) AND Member = TRUE. | |
| 4Brackets make an average of three marks correct by adding all the marks before dividing | DBrackets group the parts of the condition so the order in which AND and OR are applied is clear | |
| 5Average ← Total1 + Total2 / 2 | EThe brackets are missing, so only Total2 is divided by 2 and Total1 is added afterwards. It should be (Total1 + Total2) / 2. | |
| 6IF Age < 12 OR Age > 65 AND Member = TRUE THEN | FAdds A and B first because of the brackets, then divides the total by 2 to give the average |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
(A + B) / 2 — Brackets force the work inside to be done first, so A and B are added before dividing by 2. Without them, A + B / 2 divides B by 2 first. Use them in sums and AND/OR conditions.Average ← (Mark1 + Mark2) / 2Average ← (A + B + C) / 3IF (Day = "Sat" OR Day = "Sun") AND
Free = TRUEDECLARE Average : REAL
Average ← (Mark1 + Mark2) / 2IF Age > 15 AND (Pass OR Paid) THEN