Tracing a counting algorithm
In a trace table, Count goes up by 1 only on rows where the condition is TRUE. If it is FALSE, Count stays the same. The final value of Count is what the OUTPUT shows.
Understanding Tracing a counting algorithm in IGCSE Computer Science Paper 2
What it does: If Mark is 40, Mark >= 50 is FALSE, so Count ← Count + 1 is skipped and Count is unchanged on that row. Count ← 0 is the first value in the Count column. Each TRUE row then adds 1 to it. A TRUE condition means Count ← Count + 1 runs, so 2 becomes 3. 9, 7 and 8 are greater than 5 (TRUE). 4 and 2 are FALSE and are not counted, so Count is 3.
Common mistakes: The IF line has no THEN. The condition is tested, and Pass only goes up when it is TRUE, so it must be written IF Mark[i] >= 50 THEN. A FOR loop sets its start value with the assignment arrow, not =. It should be FOR i ← 1 TO 6.
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 275–285) and word search (Modules 275–295).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
Count ← Count + 1Fill in the Blanks
Spot the Error
Student with a class code? Join your class →