Learn in your language
Skip to content
IGCSE · Cambridge (CIE) · 0984

Find maximum, minimum and average values

Track extremes and calculate an average without losing the first value or dividing by zero.

Section 7 · Algorithm design and problem-solving

Cambridge IGCSE Computer Science 0984 · Algorithm design and problem-solving · 2026–2028 Version 4 · 0984 (9–1) · 7
Exam scope and assessment notes

This sequence follows Cambridge IGCSE Computer Science 0984, 2026–2028 syllabus Version 4. It covers subject content Topic 7 only. The separately published 2029–2031 syllabus is not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers and human subject-teacher review remain outstanding. Cambridge states that 0984 has the same 2026–2028 subject content as 0478, with 9–1 grading. In June and November, Cambridge lists 0984 in Administrative zone 3 and for centres in Oman and the UAE. Confirm availability for your centre and exam series with Cambridge International. The separately published 2029–2031 syllabus changes to Python 3 only and removes pseudocode; this 2026–2028 route does not cover those changes.

Before you begin

  • No programming language is required. Be comfortable with place value and multiplication; each lesson introduces the computer-science notation it uses.

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

How is an average calculated from a total and count?

What you will learn

  • Initialise maximum and minimum from valid data
  • Update extremes correctly
  • Calculate average from total and count

Track extremes and average separately

Initialise Maximum and Minimum from the first valid value rather than an arbitrary number that may not fit the data. For each later value, compare it with both extremes and update when needed.

Apply and check the rule

Average equals Total divided by Count. Count every value included in the total, and only calculate the average when Count is greater than zero. If no data is valid, report that no average is available rather than dividing by zero.

Pause and explain

What should the algorithm do if Count is zero?

Put the idea to work

Worked example

For 8, 3, 10, find the minimum, maximum and average.

Show the worked solution
  1. Initialise Min=8 and Max=8.
  2. Compare 3 and 10 with both stored extremes.
  3. Total=21, Count=3, so Average=7.

Answer Minimum 3; maximum 10; average 7.

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

Find minimum, maximum and average of 6, 9, 3, 6.

Give me a hint

Track extremes, total and number of values.

Compare my reasoning
  1. Minimum=3 and Maximum=9.
  2. Total=24 and Count=4.
  3. Average=24/4=6.

Minimum 3; maximum 9; average 6.

Look for these in your work

  • Minimum
  • Maximum
  • Average
2 · Independent

A maximum-finding algorithm starts Max at 0. Give a data set for which it returns the wrong answer and correct the initialisation.

Give me a hint

Try values below zero.

Compare my reasoning
  1. For −7 and −2, zero is larger than every data value.
  2. The algorithm incorrectly leaves Max at zero.
  3. Set Max to the first valid value, then compare remaining values.

For −7 and −2 it returns 0 incorrectly. Initialise Max to the first valid value, −7, then update it to −2.

Look for these in your work

  • Counterexample
  • Wrong result
  • Robust initialisation
3 · Transfer

A program sums four valid marks but increments Count only for marks above the pass mark. Explain how this affects its average.

Give me a hint

The numerator and denominator must describe the same set of values.

Compare my reasoning
  1. All four marks are included in Total.
  2. Only some marks are included in Count.
  3. Dividing the total by a smaller count overstates the average.

The count no longer matches the values in the total, so the average is too high. Count every mark added to the total.

Look for these in your work

  • Set mismatch
  • Effect
  • Correction

Common mistakes

  • Setting Maximum to zero when values can be negative
  • Dividing by a count that excludes a value included in the total
Recall without your notes

What can you explain now?

How should a maximum be initialised for an unknown range of valid values?

Compare with the explanation

Use the first valid value

This avoids an arbitrary starting value that could be larger or smaller than the data.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

What values are needed to calculate the average, and how should extremes be initialised?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Computer Science (9-1)

Course scope and assessment

165 original lessons map the listed objectives across all 10 main topics in the 2026–2028 Version 4 syllabus. Cambridge states that 0984 has the same subject content as 0478, with 9–1 grading. Three retained introductory lessons remain available but are not counted as syllabus-mapped teaching. The 2023–2025 syllabus remains unmapped. The separately published 2029–2031 syllabus changes to Python 3 only and removes pseudocode; this 2026–2028 route does not cover those changes. In June and November, Cambridge lists 0984 in Administrative zone 3 and for centres in Oman and the UAE. Confirm availability for your centre and exam series with Cambridge International. Practical programming in an executable browser workspace, full timed-paper practice and human subject-teacher review remain outstanding. Practice is self-checked and does not award an official Cambridge grade.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.