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.
- Error 1Error 1 Line number Correct code[1]
- Error 2Error 2 Line number Correct code[1]
- Error 3Error 3 Line number Correct code[1]
- 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 mark for each error identified and suggested correction (the corrected code must be written in full)
- Line 2 Correct code Counter = 0
- Line 7 Correct code Total = Total + Number
- Line 8 Correct code Counter = Counter + 1
- 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 →