Other Standard Methods of a Solution (Cambridge International IGCSE Computer Science)
Exam board Cambridge International · IGCSEUpdated 2026-05-24
Totalling & Counting
Spec point —
6.3.4a· 6 Understand standard methods of solution
What is totalling?
- Totalling is keeping a running total of values entered into the algorithm
- An example may be totalling a receipt for purchases made at a shop
- In the example below, the total starts at 0 and adds up the user inputted value for each item in the list
| Pseudocode |
|---|
What is counting?
- Counting is when a count is incremented or decremented by a fixed value, usually 1, each time it iterates
- Counting keeps track of the number of times an action has been performed
- Many algorithms use counting, including the linear search to track which element is currently being considered
- In the example below, the count is incremented and each pass number is output until fifty outputs have been produced
| Pseudocode |
|---|
- In the example below, the count is decremented from fifty until the count reaches zero. An output is produced for each pass
| Pseudocode |
|---|
Maximum, Minimum & Average
Spec point —
6.3.4a· 7 Understand standard methods of solution
-
Finding the largest (max), smallest (min) and average (mean) values in a list are frequently used method in algorithms
-
Examples could include:
- Calculating the maximum and minimum student grades or scores in a game
- Calculating the average grade of students in a class test
-
In the example below, in a list of student test scores, the highest, lowest and average scores are calculated and displayed to the screen
| Pseudocode |
|---|
Was this revision note helpful?
Build on this topic