CAMBRIDGE IGCSE COMPUTER SCIENCE
2023 Specimen Paper 2A · Question 13 · 15 marks
← 0478 CS Hub Specimen 2A · 2023 0478 / Paper 2 Question 13 15 MARKS
15-mark question lab · start here

From student marks to class grade statistics.

Build the solution in a sensible order: understand the data, plan the loops, initialise the counters, calculate totals and averages, select grades, and present the results. Learn the reasoning before revealing the complete program.

2D arrayNested iterationRoundingSelection and counting15 marks

Learning targets

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

Lesson overview

01 · Understand

Identify the two arrays, their matching student positions, and the values already supplied.

02 · Construct

Use nested loops to total each student’s subject marks, then calculate the rounded average.

03 · Complete

Award the correct grade, count class grades, and output every required result.

!

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 data layout, grade boundaries and output requirements all affect the structure of your solution.

Question 13 · 15 marks
Cambridge IGCSE Computer Science · 0478/02 · Question 13

The one-dimensional (1D) array StudentName[] contains the names of students in a class.
The two-dimensional (2D) array StudentMark[] contains the mark for each subject, for each student. The position of each student’s data in the two arrays is the same, for example, the student in position 10 in StudentName[] and StudentMark[] is the same.

The variable ClassSize contains the number of students in the class. The variable SubjectNo contains the number of subjects studied. All students study the same number of subjects.

The arrays and variables have already been set up and the data stored.

Students are awarded a grade based on their average mark.

Average markGrade awarded
greater than or equal to 70distinction
greater than or equal to 55 and less than 70merit
greater than or equal to 40 and less than 55pass
less than 40fail

Write a program that meets the following requirements:

  • calculates the combined total mark for each student for all their subjects
  • calculates the average mark for each student for all their subjects, rounded to the nearest whole number
  • outputs for each student:
    • name
    • combined total mark
    • average mark
    • grade awarded
  • calculates, stores and outputs the number of distinctions, merits, passes and fails for the whole class.

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

You do not need to initialise the data in the array.

Before you move on

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

Mark-scheme map
R1

Calculate each student’s total using iteration and totalling.

R2

Calculate the average and round it to the nearest whole number.

R3

Select the correct grade for each student.

R4

Output each student’s name, total, average and grade.

R5

Count, store and output the whole-class totals for all four grades.

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.