Skip to main content
O-LevelComputer ScienceProgramming2210/22 · May/June 2015 · Q24 Marks

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.

  1. 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.

  1. [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 →

About this question

Topic
Programming, O-Level Computer Science (syllabus 2210). Structured question, 4 marks.
Source
O-Level Computer Science, May/June 2015 Paper 2 Variant 2, question 2.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep