Read this section of program code that should input 30 positive numbers and then output the largest number input. 1 Large = 9999 2 Counter = 0 3 WHILE Counter > 30 4 DO 5 INPUT Num 6 IF Num < Large THEN Large = Num 7 Counter = Counter - 1 8 ENDWHILE 9 PRINT Large There are four errors in this code. Locate these errors and suggest a corrected piece of code for each error.
- Read this section of program code that should input 30 positive numbers and then output the largest number input. 1 Large = 9999 2 Counter = 0 3 WHILE Counter > 30 4 DO 5 INPUT Num 6 IF Num < Large THEN Large = Num 7 Counter = Counter - 1 8 ENDWHILE 9 PRINT Large There are four errors in this code. Locate these errors and suggest a corrected piece of code for each error.[4]
Mark scheme
Marking points from the official mark scheme (May/June 2015). The mark or mark type is shown in brackets.
- [4] 1 mark for each error identified + suggested correction Line 1 or Large =9999: this should read Large = 0 Line 3 or WHILE: this should read WHILE Counter < 30 line 6 or IF: this should read IF Num > Large THEN Large = Num line 7 or Counter =...: this should read Counter = Counter + 1
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 →