Cambridge AS Level Computer Science 9618 · 12.2 Program Design

Q20 · 9618/21/O/N/23 Q7

Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3.

Q209618/21/O/N/23original Q7Structured · 5 marks
Question 7 from 9618/21/O/N/23

Worked solution

(a)

Draw one arrow for each row of the table, labelled Input | Output. S1 and S2 and their two arrows are already drawn, so add the rest.

Label the empty circle S2 [1]

Add circles S3, S4 and S5 [1]

Add an arrow from S1 to S3 labelled A9 | X9 [1]

Add all three arrows between S2 and S5: S2 to S5 labelled A2 | X4, S5 to S2 labelled A4 | X2, and a loop on S5 labelled A1 | X1 [1]

Add S5 to S3 labelled A3 (no output) and S3 to S4 labelled A9 | X9 [1]

KEY IDEATurn each table row into one labelled arrow from the current state to the next state; a row with the same state twice is a loop.
TOTAL 5 marks

Official mark scheme

Mark scheme for 9618/21/O/N/23 question 7
VIDEO
▶ Starts at Q7 (45:09)

Starts at Q7 (45:09) · 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.