Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3.
Draw one arrow for each row of the table, labelled input | output (no output means only the input).
| From | Label | To | |
|---|---|---|---|
| S1 | A1 | S2 | |
| S2 | A2 \ | X4 | S3 |
| S3 | A1 \ | X1 | S3 (loop) |
| S3 | A2 \ | X1 | S3 (loop) |
| S3 | A3 \ | X3 | S4 |
| S3 | A4 | S2 | |
| S4 | A3 \ | X4 | S5 |
| S4 | A4 \ | X4 | S5 |
| S4 | A1 | S2 |
The state S5 drawn and labelled [1]
Label A1 added to the arrow from S1 to S2 [1]
Arrows between S2 and S3 in both directions, labelled A2 | X4 (S2 to S3) and A4 (S3 to S2) [1]
Arrows from S3: the loop labelled A1 | X1 and A2 | X1, and S3 to S4 labelled A3 | X3 [1]
Arrows from S4 to S5 (A3 | X4 and A4 | X4) and from S4 to S2 (A1) [1]
Extra events or lines not in the table lose marks (only 4 marks possible if there are any).
Setup chooses between two modules, so draw a diamond. Restart repeats two modules, so draw a curved arrow.
Boxes for Setup at the top, Restart and Confirm below it, and Update and Modify below Restart, all joined correctly [1]
BYREF string parameter to Restart (arrow both ways), string parameter to Confirm and the integer return from Confirm [1]
Diamond under Setup and the curved (loop) arrow under Restart [1]
String parameter to Update, and the Boolean return value from Modify [1]
▶ Topic lesson
A lesson on this topic · by ZAINEMATICS. 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.