An algorithm will: 1. input a sequence of integer values, one at a time 2. ignore all values until the value 27 is input, then sum the remaining values in the sequence 3. stop summing values when the value 0 is input and then output the sum of the values.
- (a)Draw a program flowchart to represent the algorithm.[5]
- (b)The solution to the algorithm includes iteration. Give the name of a suitable loop structure that could be used. Justify your answer. Name Justification[2]
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 2023). The mark or mark type is shown in brackets.
- [5] One mark per point:
- 1 Initialise Total to zero
- 2 Check for only first input of 27 in a loop then attempt to sum values
- 3 Loop until 0 input
- 4 Sum values input (after input of first 27) in a loop
- 5 Output Total after a reasonable attempt
- [2] One mark per point:
- 1 Name: (pre / post) conditional loop
- 2 Justification: the number of iterations is not known // loop ends following a specific input (in the loop)
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 →