Count, add, compare.

Six original Cambridge-style questions on the totalling, counting, maximum, minimum and average standard methods.

Original questions All questions on this page are original work, written in the Cambridge IGCSE style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

Initialise, update, finish.

01
Explain
[2 marks]

Explain the difference between totalling and counting in an algorithm.

  • Totalling adds each value to a running total, e.g. Total ← Total + Value. ✓
  • Counting adds 1 each time something happens, e.g. Count ← Count + 1. ✓
02
Trace
[4 marks]

The algorithm in this lesson is run with the marks 55, 72, 18, 90, 40. State the final values of Total, CountPass, Highest and Lowest.

  • Total = 55 + 72 + 18 + 90 + 40 = 275. ✓
  • CountPass = 3 (55, 72 and 90 are at least 50). ✓
  • Highest = 90. ✓
  • Lowest = 18. ✓
03
Calculate
[1 marks]

Using your answer to the previous question, state the average output by the algorithm.

  • 275 / 5 = 55. ✓
04
Write
[5 marks]

Write pseudocode to input the number of goals scored in each of 10 matches, then output the total number of goals and how many matches had no goals.

  • Initialise Total ← 0 and NoGoals ← 0 before the loop. ✓
  • FOR Match ← 1 TO 10 ... NEXT Match. ✓
  • INPUT Goals inside the loop (with a prompt). ✓
  • Total ← Total + Goals; IF Goals = 0 THEN NoGoals ← NoGoals + 1. ✓
  • OUTPUT Total and NoGoals after the loop. ✓
05
Analysis
[2 marks]

A program finds the fastest (smallest) race time in seconds. It starts with Fastest ← 0. Explain the problem and give a better starting value.

  • No race time is less than 0, so Fastest is never replaced and the output is always 0. ✓
  • Start with a very large value (e.g. 9999) or with the first time input. ✓
06
Write
[3 marks]

The array Heights[1:25] holds the heights of 25 students. Write pseudocode to find and output the greatest height, using the first element as the starting value.

  • Tallest ← Heights[1]. ✓
  • FOR Index ← 2 TO 25; IF Heights[Index] > Tallest THEN Tallest ← Heights[Index]; NEXT Index. ✓
  • OUTPUT Tallest after the loop. ✓

Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.