← All Paper 2 problems·All lessons
Paper 2 scenario practice

Marks above the class average

The scenario
A class of 30 students has completed a Computer Science test, marked out of 100. The class teacher wants a program that: 1. Reads in each student's NAME and their MARK. 2. Calculates the AVERAGE mark for the class. 3. Outputs the average mark. 4. Outputs the NAMES of every student whose mark is ABOVE the average. Write a program in pseudocode (or a high-level language of your choice) to perform this task. Marks will be awarded for input handling, calculation, decision logic, output, and clear program structure.
Lessons that prepare for this: Lesson 19 — Pseudocode and flowcharts · Lesson 23 — Programming concepts (variables, types) · Lesson 24 — Arrays
Marking scheme — total 15 marks
Cambridge IGCSE 0478 Paper 2
  • 2
    Declare variables / arrays with care: DECLARE statements with sensible identifiers and correct types (STRING for names, INTEGER for marks, INTEGER for total).
  • 3
    Input loop: Use a FOR loop to read 30 names AND 30 marks into parallel arrays. Each iteration reads ONE name and ONE mark.
  • 3
    Calculate total and average: Maintain a running total inside the input loop (or compute after). Divide by 30 to get the average. Output the average.
  • 4
    Identify above-average students: Loop through the marks. For each mark, IF it is greater than the average, OUTPUT the corresponding name. The condition must be strictly greater than (above), not ≥.
  • 3
    Program structure and naming: Code reads top-to-bottom; identifiers are clear (not x, y); IF/ENDIF and FOR/NEXT properly paired; reasonable indentation.
Hints — reveal one at a time, only if stuck
Your pseudocode workspace
1 line