The flowchart represents an algorithm. The algorithm will terminate if −1 is entered. [Figure 5.1]
- (a)Complete the trace table for the input data: 50, 75, 99, 28, 82, 150, -1, 672, 80[4]
- (b)Describe the purpose of the algorithm.[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 (May/June 2021). The mark or mark type is shown in brackets.
- [1] Row 1 (Value 50): Diff1 = 50, Diff2 = 0, OUTPUT = Accept: Extreme
- [1] Row 2 (Value 75): Diff1 = 25, Diff2 = 25, OUTPUT = Accept: Normal
- [1] Row 3 (Value 99): Diff1 = 1, Diff2 = 49, OUTPUT = Accept: Normal
- [1] Row 4 (Value 28): Diff1 = null, Diff2 = null, OUTPUT = Reject: Abnormal
- [1] Row 5 (Value 82): Diff1 = 18, Diff2 = 32, OUTPUT = Accept: Normal
- [1] Row 6 (Value 150): Diff1 = null, Diff2 = null, OUTPUT = Reject: Abnormal
- [1] Row 7 (Value -1): Termination (no output)
- [1] To output the type of test data
- [1] by performing a range check // by checking if numbers are within the range 50 and 100 (inclusive) (or not).
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 →