← IGCSE Computer Science Paper 2

Suggesting a correction

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.

Understanding Suggesting a correction in IGCSE Computer Science Paper 2

What it does: This names the line, gives the reason (wrong loop bound) and writes the replacement statement with the right upper limit. The effect of a fix is about the output or behaviour of the algorithm. It is not about speed. The faulty symbol is =, not +. Assignment in pseudocode uses ←. Deleting the line would mean no total is output at all. Moving it fixes the problem and keeps the output. The student quotes the wrong symbol and writes the fix, so Count is updated instead of being compared. A suggested correction must be specific: name the line, explain the problem and write the replacement code.

Common mistakes: Line 4 is wrong because = is a comparison, not an assignment. It should be Total ← Total + Mark. With the fix, each mark is added to the running total, so the output is the sum of all five marks. Line 1 is wrong because the counter starts at 1, so it is one too high. It should be Passes ← 0. With the fix, the output is the true number of passes instead of always being one too many.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 242–253) and word search (Modules 232–253).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Line 3 of a totalling algorithm is Total ← 5. Which is the better correction?
Line 3 Total ← 5 is wrong because the total must start at 0. Change it to Total ← 0, so the answer is no longer 5 too high.Line 3 is wrong. The algorithm needs rewriting.
Matches
The error is somewhere in the loop. Change it so it works.
↓
Does not name the exact line or symbol, does not say why it is wrong, and gives no corrected statement
Applying
Meanings
Term
Line 3 should be Total ← 0
Meaning
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.
Practice
// Line 3 is wrong: Total is not set to zero
Testing
Gaps
Correct line 3: Total 0
Check Answer
Spots
3 INPUT Mark
4 Total = Total + Mark

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Warthog' badge — Definition Digger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Line 3 of a totalling algorithm is Total ← 5. Which is the better correction?
A. Line 3 Total ← 5 is wrong because the total must start at 0. Change it to Total ← 0, so the answer is no longer 5 too high. ✓
B. Line 3 is wrong. The algorithm needs rewriting.
A good correction names the line, says why it is wrong, gives the new statement and explains the effect.
2. Line 4 is IF Mark > 50 THEN, but 50 should also count. Which correction is complete?
A. Line 4 should be changed to make the program work better.
B. Line 4 should be IF Mark >= 50 THEN, so a mark of exactly 50 is now counted. ✓
The vague answer gives no replacement line and does not say what the fix changes.
3. The loop on line 2 is FOR Count ← 1 TO 9 but there are 10 numbers. Which explains the effect of the fix?
A. Changing TO 9 to TO 10 makes the loop run faster.
B. Changing TO 9 to TO 10 makes the loop run 10 times, so all ten numbers are processed. ✓
The effect of a fix is about the output or behaviour of the algorithm. It is not about speed.
4. True or false: writing 'Line 5 is wrong' is a full correction.
A. False. You must also say why it is wrong and write the corrected statement. ✓
B. True. Naming the line is all that is needed.
Naming the line is only the first part. You also need the reason, the replacement and the effect.
5. Line 3 is WHILE Num <> 0 DO, but Num never changes inside the loop. Which correction is better?
A. Add Num ← Num - 1 inside the loop, so the condition eventually becomes false and the loop stops. ✓
B. Line 3 is wrong because loops never end. Make the loop shorter.
The correct answer gives the exact new statement and explains how it stops the infinite loop.

Match the Pairs

Line 3 should be Total ← 0 → Names the faulty line and writes the replacement statement, so the totalling variable starts from zero
Line 5: change = to ← in Count = Count + 1 → Quotes the faulty line and replaces the comparison symbol with the assignment arrow
Say why the line is wrong and give the corrected statement: the loop must stop at 10, not 11 → Line 2 should be FOR Index ← 1 TO 10
Explain the effect of the fix: the loop now ends, so the program no longer repeats forever → Line 4 should be Number ← Number + 1 inside the WHILE loop
The error is somewhere in the loop. Change it so it works. → Does not name the exact line or symbol, does not say why it is wrong, and gives no corrected statement
Line 6 is wrong. It should be fixed. → Names the line but gives no reason and no replacement statement, and does not explain the effect on the output

Key Term

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.

Fill in the Blanks

1. Faulty line 3: Total = 0 Correct line 3: Total ← 0 Why: assignment needs the arrow symbol
Hint: Type the assignment symbol used in pseudocode
2. Line 2 is wrong: Count is not set first Correction: Count ← 0 Effect: the count starts from zero
Hint: Type the starting value a counter needs before the loop
3. Faulty line 1: FOR Index ← 1 TO 9 Correct line 1: FOR Index ← 1 TO 10 Effect: all 10 array items are processed
Hint: Type the final loop value so every item in a 10-item array is covered
4. Pass is 50 or more. Faulty: IF Mark > 50 Correct: IF Mark >= 50 THEN Effect: a mark of 50 now counts as a pass
Hint: Type the relational operator that includes the boundary value
5. Faulty: the IF statement has no closing line Correction: add ENDIF after the last line Effect: the selection is now complete
Hint: Type the keyword that closes an IF statement

Spot the Error

Question 1
A Total ← 0
B FOR Count ← 1 TO 5
C INPUT Mark
D Total = Total + Mark
E NEXT Count
F OUTPUT Total
Line D — Line 4 is wrong because = is a comparison, not an assignment. It should be Total ← Total + Mark. With the fix, each mark is added to the running total, so the output is the sum of all five marks.
Question 2
A Passes ← 1
B INPUT Mark
C IF Mark >= 50 THEN
D Passes ← Passes + 1
E ENDIF
F OUTPUT Passes
Line A — Line 1 is wrong because the counter starts at 1, so it is one too high. It should be Passes ← 0. With the fix, the output is the true number of passes instead of always being one too many.
Question 3
A INPUT Age
B IF Age > 12 OR Age < 20 THEN
C OUTPUT "Teenager"
D ENDIF
Line B — Line 2 is wrong because OR makes the condition true for every age. It should be IF Age > 12 AND Age < 20 THEN. With the fix, only ages 13 to 19 are output as Teenager.
Question 4
A Total ← 0
B FOR Count = 1 TO 5
C Total ← Total + Count
D NEXT Count
E OUTPUT Total
Line B — Line 2 is wrong because a FOR loop sets its start value with the assignment arrow, not =. It should be FOR Count ← 1 TO 5. With the fix, the loop is valid and runs five times to total 1 to 5.
Question 5
A DECLARE Price : INTEGER
B OUTPUT "Price, e.g. 2.50"
C INPUT Price
D OUTPUT Price * 3
Line A — Line 1 is wrong because prices such as 2.50 have decimal places, which an INTEGER cannot store. It should be DECLARE Price : REAL. With the fix, the pence are kept and the output is correct.

Student with a class code? Join your class →