Note AcademyNote Academy

Computer Science · May / June 2017 · Paper 21 · Question 2

2210

As printed in the paper

The question as text

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 1 Line number Correct code Error 2 Line number Correct code Error 3 Line number Correct code Error 4 Line number Correct code [4]

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.