Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3.
Count from the diagram. Inputs on the arrows are Button-X, Button-Y and Button-Z. Outputs are Output-A, Output-B and Output-C. Both arrows that enter S4 (from S2 and from S3) use Button-Y, so that is the single input.
| Answer | |
|---|---|
| The number of different inputs | 3 |
| The number of different outputs | 3 |
| The single input value that could result in S4 | Button-Y |
Inputs: 3 [1]
Outputs: 3 [1]
Input that results in S4: Button-Y [1]
Follow the diagram from S1: Button-Y goes to S3. Button-Y from S3 goes to S4. Button-Z from S4 goes to S2 with Output-B. Button-Z from S2 goes to S1.
| Input | Output | Next state |
|---|---|---|
| Button-Y | none | S3 |
| Button-Y | none | S4 |
| Button-Z | Output-B | S2 |
| Button-Z | none | S1 |
Row 1 correct [1]
Row 2 correct [1]
Row 3 correct [1]
Row 4 correct [1]
Other answers that follow valid arrows in the diagram are also accepted.
▶ Whole paper
Video solution of the whole paper · by CS BY AQIB KHAN. 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.