Worked solution from the Programming Paper 2 Problem-solving and Programming booklet, Part 1 of 3.
Use constants [1]
Any three of these:
The postal cost is entered once only [1]
It avoids input errors and different values for the same cost in different places [1]
When rates change, the constant is changed once only, so the program is easier to maintain [1]
The program is easier to understand because the constant has a meaningful name (also scores, but only three marks are available).
Any three of these:
Indentation [1]
Comments [1]
Capital letters for keywords [1]
Sensible, meaningful variable names or white space also score, but only three marks are available.
ValidAddress: BOOLEAN [1]
ItemPostalCost: REAL [1]
ItemStatus: STRING [1]
▶ Starts at Q1 (0:18)
Starts at Q1 (0:18) · by Pseudocode Pro. 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.