Skip to main content
O-LevelComputer ScienceProgramming2210/21 · May/June 2017 · Q24 Marks

This section of program code asks for 50 numbers to be entered. The total and average of the numbers are calculated. ``` 1 Total = 0 2 Counter = 50 3 PRINT 'When prompted, enter 50 numbers, one at a time' 4 REPEAT 5 PRINT 'Enter a number' 6 INPUT Number 7 Total + Number = Total 8 Number = Number + 1 9 UNTIL Counter = 50 10 Average = Number * Counter 11 PRINT 'The average of the numbers you entered is ', Average ``` There are four errors in this code. State the line number for each error and write the correct code for that line.

  1. Error 1Error 1 Line number Correct code[1]
  2. Error 2Error 2 Line number Correct code[1]
  3. Error 3Error 3 Line number Correct code[1]
  4. Error 4Error 4 Line number Correct code[1]

Mark scheme

Marking points from the official mark scheme (May/June 2017). The mark or mark type is shown in brackets.

  1. [1] 1 mark for each error identified and suggested correction (the corrected code must be written in full)
  2. Line 2 Correct code Counter = 0
  3. Line 7 Correct code Total = Total + Number
  4. Line 8 Correct code Counter = Counter + 1
  5. Line 10 Correct code Average = Total / Counter // Average = Total / 50

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 2017 Paper 2 Variant 1, 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