Read this section of program code that inputs 10 positive numbers and then outputs the smallest number input. 1 Small = 1000 2 Counter = 0 3 REPEAT 4 INPUT Num 5 IF Num < Small THEN Small = Num 6 Counter = Counter + 1 7 UNTIL Counter = 10 8 PRINT Small
- (i)Identify three changes you would need to make to find the largest number input instead of the smallest number.[3]
- (ii)Rewrite the program code with your changes.[3]
Mark scheme
Marking points from the official mark scheme (May/June 2016). The mark or mark type is shown in brackets.
- [3] (i) 1 mark for each change Change variable name in every instance as needs to be meaningful e.g. Large Set this variable to a low value line 5: change comparison from < to >
- [3] (ii) 3 marks maximum, 1 mark for each change correctly included. 1 Large = 0 2 Counter = 0 3 REPEAT 4 INPUT Num 5 IF Num > Large THEN Large = Num 6 Counter = Counter + 1 7 UNTIL Counter = 10 8 PRINT Large
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 →