9618/23/O/N/25 question 7: worked solution (October/November 2025, paper 23)

Show as plain text

Cambridge AS Level Computer Science 9618 · 12.2 Program Design Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3. Q32 9618/23/O/N/25 original Q7 Structured · 9 marks Worked solution (a) 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). (b) 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] KEY IDEA Show selection with a diamond and repetition with a curved arrow, and label every parameter and return value on its arrow. TOTAL 9 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by ZAINEMATICS. Tap the picture to open it on YouTube.