Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3.
Decomposition splits a big job into small jobs. Write three sub-modules, each with its use (any three):
IdentifyMember() – finds a club member who has asked to join the class that now has a free space [1]
GetMemberPhoneNumber() – gets the mobile phone number of a member [1]
CreateMessage() – makes the text message for a member [1]
Other correct sub-modules also score, for example SendMessage(), which sends the text message to a member on the waiting list.
Start in S1 and follow the arrows. The current state of each row is the next state of the row above:
| Input | Output | Next state |
|---|---|---|
| S1 | ||
| Input-A | none | S3 |
| Input-A | Output-W | S3 |
| Input-B | none | S2 |
| Input-B | none | S5 |
| Input-A | none | S2 |
| Input-A | Output-X | S4 |
Row 3: Input-A, Output-W, S3 (the loop on S3) [1]
Row 4: Input-B, none, S2 [1]
Row 5: Input-B, none, S5 [1]
Row 6: Input-A, none, S2 [1]
Row 7: Input-A, Output-X, S4 [1]
The shortest route from S1 to S4 is S1 → S2 (Input-B) then S2 → S4 (Input-A), which is two changes.
Write: Input-B, Input-A [1]
▶ Starts at Q7 (1:03:19)
Starts at Q7 (1:03:19) · 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.