Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3.
Head() calls three modules in order and repeatedly, so draw an iteration arc across its three lines. Add the missing parameters: Mod_V takes an INTEGER and Mod_Z takes a REAL.
Iteration arc drawn across the three lines from Head() (A) [1]
Parameter arrow (open circle) going down on the line from A to D, for the INTEGER passed to Mod_V [1]
Parameter arrow (open circle) going down on the line from D to E, for the REAL passed to Mod_Z [1]
Match the boxes to the headers. B has one down parameter, so Mod_W. C has a parameter passed both ways (BYREF), so Mod_X. D returns a flag (BOOLEAN), so Mod_V. E returns data, so Mod_Z. F has two parameters down, so Mod_Y.
| Label | Module name |
|---|---|
| A | Head |
| B | Mod_W |
| C | Mod_X |
| D | Mod_V |
| E | Mod_Z |
| F | Mod_Y |
Any two rows correct [1]
Four rows correct [1]
All six rows correct [1]
Any three benefits:
A complex problem is easier to understand and solve when it is broken into smaller problems [1]
Smaller modules are easier to program, test and maintain [1]
Sub-problems can be given to different programmers or teams and solved separately [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.