Counting: how it works
Counting adds 1 to a counter each time something happens. Start the counter at 0, add 1 (not the item's value), and do it for every item or only for matches.
Understanding Counting: how it works in IGCSE Computer Science Paper 2
What it does: Putting the counter update inside an IF means only matching items are counted, instead of every item. A counter starts at 0 because nothing has been counted yet. Starting at 1 would make the final answer one too high. Counting always adds 1, no matter what the item is. Adding the item's value is totalling, not counting. Count + 1 counts items. Count + Number adds up the values, which is totalling. 'How many' is counting. 'The sum of' is totalling.
Common mistakes: Counting adds 1 each time, not the item's value. Adding Mark makes a total, not a count. It should be Count ← Count + 1. The condition only matches marks of exactly 50, so passes above 50 are missed. To count every pass it should be IF Mark[Index] >= 50 THEN.
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 →