The flowchart shows an algorithm that is used to input 50 numbers. Each number is stored in the variable Value when it is input. Any number input that is less than or equal to –20 or greater than or equal to 50 is rejected and re-input. The accepted numbers are added together as they are entered and the total and average of these numbers are output at the end of the algorithm.
- (a)Complete the flowchart. [Figure 7.a][6]
- (b)Explain how you would alter the flowchart in 7(a) so that it will individually store each accepted value as it is entered and then output all the numbers, one after the other, outside of the loop that inputs values. You may include program statements or flowchart symbols in your answer, but they must be fully explained.[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 (May/June 2025). The mark or mark type is shown in brackets.
- [6] (a) One mark per mark point, max six MP1 input Value MP2 correct check that Value is between -20 and 50, exclusive MP3 totalling values MP4 counting number of values MP5 checking Count = 50/ >= 50 MP6 output of total and average
- (a) Flowchart (completed nodes, top to bottom, left to right for loops): 1. Input box: INPUT Value 2. Decision box: IS Value <= -20 OR Value >= 50 ? (Yes/No) 3. Rectangle after 'No': Total ← Total + Value 4. Rectangle after 'Total': Count ← Count + 1 5. Decision box: IS Count = 50 ? (Yes/No) (leading to OUTPUT Total / OUTPUT Total/50 or back to input) 6. Output box: OUTPUT Total 7. Output box: OUTPUT Total/50
- [4] (b) One mark per statement MP1 Change INPUT Value so that it saves values into an array MP2 using the counter as the index MP3 Outside the (first) loop, set up a loop that will iterate 50 times MP4 Use an output statement inside the (second) loop to output the contents of the array, using the counter as the 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 →