Worked solution from the Programming Paper 2 Problem-solving and Programming booklet, Part 3 of 3.
Write any two of these:
A task that is repeated can be written once and reused or called from several places [1]
A specific task can be coded as its own module, which makes the program simpler [1]
Also accepted: a module may already be available, or testing, debugging and maintenance are easier
Write one of these:
A local variable can only be used inside the module where it is declared, but a global variable can be used by the whole program [1]
A local variable uses memory only while its module runs, but a global variable uses memory all the time the program runs (also accepted).
Write any two of these:
The same variable name can be reused in other modules [1]
The module is self-contained, so it cannot accidentally change a variable outside it [1]
Also accepted: it helps modularisation, or the memory can be reused when the module is not running
Use the insert's functions to complete each row:
| Expression | Evaluates to |
|---|---|
| CHR(68) | 'D' |
| MONTH(04/02/2025) | 2 |
| NOT TRUE | FALSE |
| STR_TO_NUM(MID("Court1.4Upper", 6, 3)) | 1.4 |
CHR [1]
MONTH (or DAY(...) - 2, or YEAR(...) - 2023) [1]
NOT (or FALSE = TRUE) [1]
STR_TO_NUM around the MID function [1]
MID("Court1.4Upper", 6, 3), which starts at character 6 and takes 3 characters [1]
Choose the type from how each value is used:
| Variable | Data type |
|---|---|
| MemberCount | INTEGER |
| TotalTakings | REAL |
| BookingConfirmed | BOOLEAN |
| MemberDOB | DATE |
MemberCount is a whole number: INTEGER [1]
TotalTakings is money with decimals: REAL [1]
BookingConfirmed has two states: BOOLEAN [1]
MemberDOB is a date: DATE [1]
▶ Whole paper
Video solution of the whole paper · by Awab Aqib. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.