The flowchart represents an algorithm that performs a process on groups of values that are input. The algorithm will fail if the first value of any group is 0. An input of –1 will terminate the algorithm.
- (a)Complete the trace table for the input data: 25, 35, 3, 0, 57, 20, 25, 18, 0, –1, 307, 40, 0 Value Average Total Count OUTPUT[5]
- (b)Describe the purpose of the algorithm.[2]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2023). The mark or mark type is shown in brackets.
- [5] One mark per correct column, max five
- Value | Average | Total | Count | OUTPUT
- ------|---------|-------|-------|----------
- | | 0 | 0 |
- 25 | | 25 | 1 |
- 35 | | 60 | 2 |
- 3 | | 63 | 3 |
- 0 | 21 | | | Total is 63
- | | | | Average is 21
- | | 0 | 0 |
- 57 | | 57 | 1 |
- 20 | | 77 | 2 |
- 25 | | 102 | 3 |
- 18 | | 120 | 4 |
- 0 | 30 | | | Total is 120
- | | | | Average is 30
- | | 0 | 0 |
- -1 | | | |
- [2] One mark per mark point, max two
- MP1 to add together / find the average of a batch of numbers
- MP2 the total and average are output (when the batch is complete/when 0 is entered)
- MP3 when 0 is entered a new batch is started.
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 →