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 | |
|---|---|---|
| 1Line 3 should be Total ← 0 | ANames the line but gives no reason and no replacement statement, and does not explain the effect on the output | |
| 2Line 5: change = to ← in Count = Count + 1 | BQuotes the faulty line and replaces the comparison symbol with the assignment arrow | |
| 3Say why the line is wrong and give the corrected statement: the loop must stop at 10, not 11 | CNames the faulty line and writes the replacement statement, so the totalling variable starts from zero | |
| 4Explain the effect of the fix: the loop now ends, so the program no longer repeats forever | DLine 4 should be Number ← Number + 1 inside the WHILE loop | |
| 5The error is somewhere in the loop. Change it so it works. | ELine 2 should be FOR Index ← 1 TO 10 | |
| 6Line 6 is wrong. It should be fixed. | FDoes not name the exact line or symbol, does not say why it is wrong, and gives no corrected statement |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Line 3 should be Total ← 0 — To suggest a correction, name the wrong line or symbol, say why it is wrong, write the corrected statement, and explain what the fix changes in the algorithm's output.Faulty line 3: Total = 0
Correct line 3: Total ← 0
Why: assignment needs the arrow symbolLine 2 is wrong: Count is not set first
Correction: Count ← 0
Effect: the count starts from zeroFaulty line 1: FOR Index ← 1 TO 9
Correct line 1: FOR Index ← 1 TO 10
Effect: all 10 array items are processedPass is 50 or more. Faulty: IF Mark > 50
Correct: IF Mark >= 50 THEN
Effect: a mark of 50 now counts as a passFaulty: the IF statement has no closing line
Correction: add ENDIF after the last line
Effect: the selection is now complete