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

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. Q20 9618/21/O/N/23 original Q7 Structured · 5 marks 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 IDEA Turn 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 VIDEO ▶ Starts at Q7 (45:09) Starts at Q7 (45:09) · by Pseudocode Pro. Tap the picture to open it on YouTube.