A program has been written in pseudocode to input five numbers between 1 and 900 inclusive and store the highest number and the lowest number entered. 01 Lowest ← 900 02 Highest ← 1 03 FOR Count ← 1 ΤΟ 5 04 INPUT Number 05 IF Number < Lowest 06 THEN 07 Lowest ← Number 08 ELSE 09 IF Number > Highest 10 THEN 11 Highest ← Number 12 ENDIF 13 ENDIF 14 NEXT Count
- (a)Complete the trace table for the algorithm using the following numbers: 563, 21, 376, 99, 400. Count Number Lowest Highest[4]
- (b)The algorithm does not work correctly. State the reason why the algorithm does not work as expected and explain how the algorithm could be corrected. Any code used must be fully explained. Reason Correction[2]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2025). The mark or mark type is shown in brackets.
- [1] (a) Initial values for Lowest and Highest correct
- [1] (a) All values in 'Number' column correct
- [1] (a) All values in 'Lowest' column correct
- [1] (a) All values in 'Highest' column correct
- (a) Trace Table Values: Initial Lowest=900, Highest=1; Count=1, Number=563, Lowest=563, Highest=1; Count=2, Number=21, Lowest=21, Highest=1; Count=3, Number=376, Lowest=21, Highest=376; Count=4, Number=99, Lowest=21, Highest=376; Count=5, Number=400, Lowest=21, Highest=400
- [1] (b) the highest score is incorrect / algorithm cannot evaluate highest value if lowest evaluated
- [1] (b) replace ELSE on line 08 with ENDIF and remove ENDIF on line 13 / remove nested IF and have single IF statements for Highest/Lowest
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 →