There are several different ways to express an algorithm during the design of a program.
- (a)One part of the program contains an algorithm which is represented by a state-transition diagram. The table shows the inputs, outputs and states for the algorithm: Current state Input Output Next state S1 A2 X2 S3 S1 A1 X1 S2 S2 A4 X4 S5 S3 A1 S3 S3 A3 X3 S2 S3 A2 X4 S4 S4 A1 X1 S4 S4 A3 S2 S4 A4 X4 S5 Complete the state-transition diagram to represent the information given in the table. START S1 A2 | X2[5]
- (b)A structure chart is used to document a different part of the program. This part of the program contains six modules: Pseudocode module header PROCEDURE Setup() PROCEDURE Restart(H1 : STRING, C1 : INTEGER) FUNCTION Modify(B1 : BOOLEAN) RETURNS INTEGER PROCEDURE Final(T1 : INTEGER) PROCEDURE Update(BYREF R2 : STRING) FUNCTION Confirm() RETURNS BOOLEAN Module Setup will repeatedly call three of the modules. Complete the structure chart to document the information given in the table. Setup H1 B1 R2[5]
This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2025). The mark or mark type is shown in brackets.
- [5] (a) Label A1 | X1 added on line from S1 to state labelled S2
- [5] (a) States S3, S4 and S5 labelled
- [5] (a) Line from S2 to S5 with event label A4|X4
- [5] (a) Lines from S3 with correct event labels including 'loop' label
- [5] (a) Lines from S4 with correct event labels including 'loop'
- [5] (b) All boxes correctly labelled
- [5] (b) Iteration arrow
- [5] (b) Parameter to Restart
- [5] (b) Return value from Modify and parameter to Final
- [5] (b) BYREF parameter to Update
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →