Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3.
Module-A() calls Module-X(), Module-Z() or Module-Y(). Module-X() calls Reset() and Module-Y() calls Restore(). Fill the boxes, then add the arrows (open circle = data, filled circle = flag).
Names in the boxes: Module-X, Module-Z, Module-Y with Reset below Module-X and Restore below Module-Y [1]
Module-X: arrows down labelled T1 and S2. Between Module-X and Reset: Code going down and back up (BYREF) [1]
Module-Z: SA going down and the integer returned going up [1]
Module-Y: RA and RB going down and a Boolean returned up. Restore: OldCode going down and a Boolean returned up [1]
The diamond is the symbol for a choice.
It shows selection: Module-A() calls one of the modules, decided while the program runs [1]
Name all four modules: Module-A calls one of Module-X, Module-Y or Module-Z [1]
▶ Starts at Q7 (40:48)
Starts at Q7 (40:48) · 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.