Cambridge O Level Computer Science · Syllabus 2210 · Programming
Totalling
What is Totalling?
Accumulating a running total by repeatedly adding each data value to a variable that was initialised to zero before the loop; written as Total becomes Total plus Value.
This definition is part of the Programming chapter in Cambridge O Level Computer Science.
Totalling in context
Totalling is accumulating values into a variable: Total ← Total + Value. Counting is recording how many times something happened: Count ← Count + 1. They look almost identical and are constantly confused, but they answer different questions — how much altogether? against how many? — and the value added is different: the data item for a total, always the number 1 for a counter. Both must be initialised to 0 before the loop, and a counter should be incremented only when its condition is satisfied.
Common mistakes with Totalling
- M10. “Counting and totalling are the same operation.” TruthA total adds the data value: Total ← Total + Value. A counter adds one: Count ← Count + 1. They answer different questions. WatchA counter that answers “how many that…” must be inside the IF, not after ENDIF.

