REVISION GUIDE · IGCSE 0478 PAPER 2
How to answer the 15-mark scenario question in IGCSE Computer Science Paper 2
The last question on Paper 2 is worth 15 marks, a fifth of the paper. Here is a step-by-step method, an original practice task and a full model answer.
1. What the question looks like
The final question on Cambridge IGCSE Computer Science 0478 Paper 2 describes a real-world scenario, such as a shop, a club or a school, and asks you to write a program for it. You can answer in pseudocode or in a programming language (Python, Visual Basic or Java). It usually involves arrays (often a 2D array), input with validation, loops, totals or averages, and clear output.
The question is marked as a whole using levels, not one tick per line. Examiners look at how well your program meets each requirement in the question and how good your programming techniques are. A program that covers every requirement simply will score far higher than a clever program that misses some.
2. A 6-step method
- Underline every requirement. Number them in the margin: 1 input, 2 validate, 3 store, 4 calculate, 5 find highest, 6 output. Each one is a section of your program.
- Use the names given. If the question names arrays or variables (e.g.
Scores,StudentName), use exactly those names. Do not invent new ones for the same data. - Declare your variables. In pseudocode, write
DECLAREwith a data type for every variable you add. - Write it in the same order as the requirements. It keeps you organised and makes it easy for the examiner to find each part.
- Validate every input the question mentions. Use a loop that keeps asking until the value is valid, and show an error message.
- Output exactly what is asked, with a message:
OUTPUT "Highest total: ", Highest, not justOUTPUT Highest.
3. Practice task (original exam-style question)
A school holds a sports day for 30 students. Each student takes part in 4 events and gets a score from 0 to 10 in each event.
The student names are already stored in the 1D array StudentName[1:30]. The scores will be stored in the 2D array Score[1:30, 1:4].
Write a program that:
- inputs the 4 scores for each student and stores them in
Score - validates each score so that it is between 0 and 10 inclusive
- calculates and outputs each student’s name and total score
- calculates and outputs the average total score for the whole group, to 1 decimal place
- finds and outputs the name of the student with the highest total score.
You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare StudentName or initialise it. [15]
Try it yourself first. Give yourself about 20 minutes, then compare with the model answer.
4. Model answer in pseudocode
// declare the score array and working variables
DECLARE Score : ARRAY[1:30, 1:4] OF INTEGER
DECLARE Student, EventNo, Mark, Total, GroupTotal : INTEGER
DECLARE Highest, HighIndex : INTEGER
DECLARE Average : REAL
GroupTotal ← 0
Highest ← -1
HighIndex ← 0
FOR Student ← 1 TO 30
Total ← 0
FOR EventNo ← 1 TO 4
// input a score and repeat until it is valid
OUTPUT "Enter score ", EventNo, " for ", StudentName[Student]
INPUT Mark
WHILE Mark < 0 OR Mark > 10 DO
OUTPUT "Invalid. Enter a score from 0 to 10"
INPUT Mark
ENDWHILE
Score[Student, EventNo] ← Mark
Total ← Total + Mark
NEXT EventNo
// output this student's total
OUTPUT StudentName[Student], " total: ", Total
GroupTotal ← GroupTotal + Total
// check for a new highest total
IF Total > Highest
THEN
Highest ← Total
HighIndex ← Student
ENDIF
NEXT Student
// average for the group, rounded to 1 decimal place
Average ← ROUND(GroupTotal / 30, 1)
OUTPUT "Average total score: ", Average
OUTPUT "Highest total: ", StudentName[HighIndex], " with ", Highest
5. Why this answer scores well
| Requirement | How the answer meets it |
|---|---|
| Input and store 4 scores per student | Nested FOR loops store each mark in Score[Student, EventNo]. |
| Validate 0 to 10 | A WHILE loop repeats the input with an error message until the value is valid. |
| Output name and total | The total is reset to 0 for each student, then output with the name. |
| Average to 1 decimal place | A running group total is divided by 30 and rounded with ROUND(…, 1). |
| Name of highest scorer | Stores the index of the highest total, then uses it to output the name. |
| Comments and good practice | Comments explain each section, variables are declared, and names are meaningful. |
6. Mistakes that cost marks
- Forgetting to reset the total inside the outer loop, so every student’s total includes the previous students.
- Validation with IF instead of a loop. An
IFonly checks once, so a second wrong value gets through. - Storing the highest score but not who got it. Keep the index too, so you can output the name.
- Using a different array name from the one in the question.
- Not closing structures. Every
FORneedsNEXT, everyWHILEneedsENDWHILE, everyIFneedsENDIF. - Running out of time. This question deserves about 20–25 minutes. Do not leave it until the last 5 minutes.
For the full pseudocode style, see our guide to writing Cambridge pseudocode. For searching and sorting inside these programs, see linear search and bubble sort in pseudocode.
7. How to practise
Pick any everyday scenario (a library, a car park, a quiz club) and write your own 5-point requirement list like the one above, then answer it in 20 minutes. Check your program against each requirement, one at a time. Use the self-marking questions on the IGCSE programming page to practise loops and arrays first, and try your code in the Coding Lab.
Frequently asked questions
How many marks is the last question on IGCSE Computer Science Paper 2?
It is worth 15 marks out of 75. It asks you to write a program for a scenario in pseudocode or program code.
Can I answer the 15-mark question in Python?
Yes. You can use pseudocode or a high-level programming language such as Python, Visual Basic or Java. Use whichever you write most accurately.
Do I lose marks for small syntax mistakes?
The question is marked on how well your program meets the requirements and on your programming techniques. Minor slips usually matter much less than missing a requirement, but your logic must still be clear and correct.
Want feedback on your own answer? In a 1-to-1 lesson we can work through scenario questions together and fix the mistakes that cost marks. Book a free demo →