← All lessons
Paper 2 — programming scenarios

Paper 2 scenario practice

Cambridge IGCSE 0478 Paper 2 ends with a 15-mark scenario question where you write a complete program from a written brief. Solutions can be given in pseudocode (recommended for most candidates), Python, Visual Basic, or Java. Solutions in any other language receive zero marks.

How each problem is structured: a Cambridge-style scenario; a marking-scheme breakdown showing how the 15 marks are awarded; three progressive hints; a workspace where you write your own pseudocode; a structural checker that flags mismatched keywords and common syntax mistakes (it does NOT verify correctness); a worked solution in pseudocode and Python.

Available now

P2-01

Marks above the class average

Warm-up

Read 30 students' names and marks; compute the average; output names of students above the average.

ArraysLoopsCalculationDecision logic
P2-02

Age validation

Standard

Read up to 20 ages, rejecting any < 0 or > 120; report count valid and average.

ValidationLoopsCounting
P2-03

Linear search of student IDs

Standard

Search a 1D array of student IDs for a target; report whether found.

Linear searchFound flagLoops
P2-04

Sort and report top scores

Standard

Sort an array of 10 scores descending using bubble sort; output the top 3 with rank labels.

Bubble sortArraysOutput formatting
P2-05

Temperature conversion subroutine

Standard

Use a FUNCTION to convert °C to °F; main program reads 5 temperatures and outputs converted values.

FunctionsParameter passingReturn values
P2-06

Library — 2D array of books

Intermediate

Track 5 books × 4 attributes (title, author, year, copies). Search by title, output the matched book's details.

2D arraysLinear searchString comparison
P2-07

Password validation

Intermediate

Read a password; check it meets three criteria (length ≥ 8, has digit, has uppercase). Report which criteria failed.

String functionsMultiple conditionsBoolean logic
P2-08

File-based score statistics

Intermediate

Read scores from a text file using EOF-controlled reading; compute statistics; write summary to a different file.

File I/OEOF readingAggregate calculations
P2-09

Menu-driven item tracker

Intermediate

Loop showing menu (1=add, 2=view, 3=quit) until user picks quit. Use CASE OF with OTHERWISE for invalid input.

REPEAT/UNTILCASE OFStructured logic
P2-10

Capstone — school report system

Capstone

Read marks for 5 students with validation, sort using paired-array bubble sort, output top performers, write report to file.

SubroutinesFile I/OValidationSortingAggregation
Complete:All 10 Paper 2 scenarios are now available. The set covers every Paper 2 question pattern Cambridge has tested in recent years.