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 > 18 THEN | A> should be >=. A person aged exactly 18 is wrongly rejected, because 18 > 18 is false. Test with the boundary value 18 and correct the operator to >=. | |
| 2IF Age >= 18 THEN | BIF Age <= 12 THEN | |
| 3To test a rule 'a pass mark is 50 or more', the boundary value 50 must be accepted, so use the operator that includes it. | C< should be <=. A Score of exactly 40 is wrongly missed, because 40 < 40 is false. Test with the boundary value 40 and correct the operator to <=. | |
| 4A rule says 'a child ticket is for ages up to and including 12'. The boundary value 12 must be included, so the operator needs an equals part. | DIF Mark >= 50 THEN | |
| 5IF Score < 40 THEN OUTPUT "Fail" ENDIF (Rule: 40 or less fails) | ECorrect operator for 'aged 18 or over': the boundary value 18 is accepted as well as everything above it. | |
| 6IF Age > 18 THEN OUTPUT "Can vote" ENDIF (Rule: 18 or over can vote) | FWrong at the boundary: a person aged exactly 18 is rejected, even though the rule says 18 or over should be accepted. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Age >= 18 — Using > instead of >= (or < instead of <=) is a logic error: the boundary value, such as Age 18, is wrongly rejected. Test the boundary value, then correct the operator.IF Age >= 18 THEN
OUTPUT "Adult"
ENDIFIF Temp <= 0 THEN
OUTPUT "Freezing: 0 counts"
ENDIF// Adults are 18 or over
IF Age >= 18 THEN
OUTPUT "Adult"Count ← 1
WHILE Count <= 10 DO
Count ← Count + 1IF Mark < 40 THEN
OUTPUT "Fail: 40 is a pass"
ENDIF