This flowchart represents an algorithm. [Figure 5.1]
- (a)The first data row of the trace table shows the values currently stored in CodeStore[] Complete the trace table for the algorithm, using the input data: 7686, Face, Speed, 432U, Yp79 Code Store Count CodeStore[] [1] [2] [3] [4] [5] [6] OUTPUT aBcd 1532 Face 63q8[6]
- (b)Describe the processes in the algorithm on page 6.[3]
- (c)The algorithm on page 6 requires the array CodeStore[] to be declared as a one-dimensional (1D) string array with six elements that are initially set to the null string "". Write the pseudocode required to declare and initialise the array CodeStore[] You do need to declare any variables used.[4]
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.
- [1] MP1 Correct Code column
- [1] MP2 Correct Store column
- [1] MP3 Correct Count column
- [1] MP4 First four CodeStore columns left unchanged
- [1] MP5 Correct CodeStore[5] and CodeStore [6] columns
- [1] MP6 Correct OUTPUT column
- Code Store Count | [1] [2] [3] [4] [5] [6] | OUTPUT
- ---------------------------------------------------------------------------------
- | aBcd 1532 Face 63q8
- 7686 FALSE 1 | aBcd 1532 Face 63q8
- 2 | aBcd 1532 Face 63q8
- 3 | aBcd 1532 Face 63q8
- 4 | aBcd 1532 Face 63q8
- TRUE 5 | aBcd 1532 Face 63q8 7686 | 7686
- 6 | aBcd 1532 Face 63q8 7686 |
- Face FALSE 1 | aBcd 1532 Face 63q8 7686 | Code used before
- Speed | aBcd 1532 Face 63q8 7686 | Length must be 4
- 432U FALSE 1 | aBcd 1532 Face 63q8 7686 |
- 2 | aBcd 1532 Face 63q8 7686 |
- 3 | aBcd 1532 Face 63q8 7686 |
- 4 | aBcd 1532 Face 63q8 7686 |
- 5 | aBcd 1532 Face 63q8 7686 |
- TRUE 6 | aBcd 1532 Face 63q8 7686 432U | 432U
- 7 | aBcd 1532 Face 63q8 7686 432U |
- Yp79 FALSE 1 | aBcd 1532 Face 63q8 7686 432U | CodeStore full
- [1] MP1 Checks that the length of the code input is 4 characters.
- [1] MP2 Checks the code against the array contents to see if it has been used before (in the last 6 codes)
- [1] MP3 If the code passes the tests, it is stored in the array
- [1] MP4 Stores the code in the lowest available index
- [1] MP5 Checks that the code store isn't full before storing a new code // Outputs a code store is full message if appropriate // Algorithm continues until the code store is full.
- [1] MP1 Declaration of array using correct name and data type
- [1] MP2 Declaration of loop counter
- [1] MP3 Use of appropriate loop for six iterations (allow any type of loop)
- [1] MP4 Assignment of all array elements to null string (using loop counter as array index)
- [4] Example: DECLARE CodeStore : ARRAY[1:6] OF STRING DECLARE Index : INTEGER FOR Index ← 1 TO 6 CodeStore [Index] ← "" NEXT Index
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 →