CAMBRIDGE IGCSE COMPUTER SCIENCE
Summer 2026 · Paper 23 · Question 10 · 15 marks
← 0478 CS Hub Paper 23 · Summer 2026 0478 / Paper 2 Question 10 15 MARKS
15-mark question lab · start here

From thirty days of BOD readings to a river pollution report.

Build the solution in a sensible order: understand the three parallel arrays, initialise the counting and totalling stores, capture the five river names and thirty days of readings, total and classify each river’s days, round the averages to two decimal places and crown the most polluted river. Learn the reasoning before revealing the complete program.

Parallel arrays2D arraysInclusive boundariesCountingFinding max15 marks

Learning targets

By the end, you should be able to explain the algorithm before writing it.

Lesson overview

01 · Understand

Identify the three parallel arrays — RiverNames[], RiverStats[] and DaysCount[] — the shared river index that links them, and the moderate and high pollution boundaries the question defines.

02 · Construct

Use nested loops to initialise the arrays, input the five names and 150 daily BOD readings, then total and classify each river’s readings with the correct inclusive and exclusive boundaries.

03 · Complete

Round each river’s average to two decimal places, output every river’s results with suitable messages, and find and output the river with the most highly polluted days.

!

How Cambridge awards the marks: the mark scheme gives AO2 a maximum of 9 marks and AO3 a maximum of 6 marks. It lists requirements R1–R5, but does not assign a separate fixed mark total to each R requirement. The stage-to-mark links in this guide show alignment, not invented stage marks.

Source question

Read the whole question first

Do not begin coding after the first paragraph. The three parallel arrays, the day-major capture order, the inclusive moderate boundary and the strictly greater high-pollution boundary all affect the structure of your solution.

Question 10 · 15 marks
Cambridge IGCSE Computer Science · 0478/23 · Question 10

Five rivers show signs of pollution and are to be monitored daily for a period of 30 days.

The one-dimensional (1D) array RiverNames[] stores the names of the rivers.

The two-dimensional (2D) array RiverStats[] stores the daily measurement of biological oxygen demand (BOD) for each river.

The two-dimensional (2D) array DaysCount[] stores the number of days each river is classed as moderately polluted and the number of days each river is classed as highly polluted.

The position of the data for any river is the same in all three arrays. For example, the data in index 2 of RiverStats[] belongs to the river in index 2 of RiverNames[].

Write a program for the following requirements:

  • Input and store the names of the rivers in the array RiverNames[]
  • For each river, input and store in the array RiverStats[], the daily BOD in milligrams per litre (mg / L) on each of the 30 days.
  • Once all the inputs for the 30 days have been completed, the following statistics are calculated, and when appropriate, stored:
    • The average daily reading for each river, rounded to two decimal places.
    • The number of days in which the BOD reading was between 2 mg / L and 8 mg / L inclusive (moderate pollution) for each river.
    • The number of days in which the BOD reading was greater than 8 mg / L (high pollution) for each river.
  • Output for each river, the average daily BOD readings, the number of days with moderate pollution and the number of days with high pollution.
  • Find and output the name of the river that has the most days with high pollution.

The program does not need to identify more than one river with an equally high pollution reading.

You must use pseudocode or program code and add comments to explain how your code works.

Do not declare arrays, variables or constants for this algorithm; assume this has been done. You will need to initialise the arrays and any variables used for counting or totalling before they are used.

All inputs and outputs must contain suitable messages.

Before you move on

These are the five required techniques identified by the Cambridge mark scheme.

Mark-scheme map
R1

Initialise RiverStats[] and the DaysCount[] counters, then input and store the five river names — initialisation, iteration, input.

R1

Input the daily BOD reading for every river on each of the 30 days, stored day by day in RiverStats[] — nested iteration, input, output.

R2

Total each river’s readings and calculate the average daily BOD rounded to two decimal places — totalling, rounding.

R2

Count each river’s moderately polluted days (2 to 8 inclusive) and highly polluted days (greater than 8) in DaysCount[] — counting, selection.

R3

Output every river’s average and counts, then find and output the river with the most highly polluted days — output, selection, finding max.

Use the tabs along the top to work through the seven stages. The complete solution is kept in its own tab, and the interactive visualisation is the final tab.