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 | |
|---|---|---|
| 1total ← 0 FOR each mark: total ← total + mark OUTPUT total / 3 (should divide by 4 marks) | AThis is a syntax error. The stray bracket breaks the writing rules, so the algorithm is not written correctly. It is not a logic error. | |
| 2OUTPUT "Total is" total ) | BA logic error: the algorithm runs to the end with no warning, but the average it outputs is wrong. | |
| 3A logic error gives no warning. The algorithm finishes but the answer is wrong, like a loop that adds 1 when it should add 2. | CThis is a logic error. It runs with no warning, but a 13 year old gets the wrong output. Testing with age 13 shows it. | |
| 4A flowchart logic error: the decision arrows for Yes and No are swapped, so the chart works but gives the wrong result. | Dcount ← 0 REPEAT 5 TIMES count ← count + 1 OUTPUT count (should count by 2s) | |
| 5IF age >= 13 THEN OUTPUT "Teen" ELSE OUTPUT "Child" (should be age >= 13 only for teen, but the test uses age > 13) | EDecision: score >= 50? Yes → OUTPUT "Fail" No → OUTPUT "Pass" | |
| 6IF score > 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF ) | FA syntax error: the line breaks the writing rules because of the stray bracket, so it cannot be followed. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
logic error — A mistake in an algorithm's steps. It still runs to the end with no warning, but gives the wrong output. Only tracing or testing shows it, unlike a syntax error that breaks the writing rules.area ← 4 + 3
OUTPUT area
// Runs, wrong output: logic errorOUTPUT "Hello
// Missing quote breaks the writing rules
// This is a syntax error// Using > here is a logic error at 13
IF age >= 13 THEN OUTPUT "Teen"x ← 2 + 3
OUTPUT x
// Only tracing or testing shows the bugDecision: mark >= 50 ?
No: OUTPUT "Fail"
// Swapping Yes and No is a logic error