Computer Science · Oct / Nov 2017 · Paper 23 · Question 2
2210
As printed in the paper
The question as text
This section of program code asks for 80 numbers between 100 and 1000 to be entered. It checks that the numbers are in the correct range, and stores them in an array. It counts how many of the numbers are larger than 500 and then outputs the result when the program is finished. 1 Count = 0 2 FOR Index = 1 TO 80 3 INPUT 'Enter a number between 100 and 1000', Number 4 WHILE Number = 99 AND Number = 1001 5 INPUT 'This is incorrect, please try again', Number 6 ENDWHILE 7 Num[80] = Number 8 IF Number > 500 THEN Count = Count + 1 9 UNTIL Index = 80 10 PRINT Index 11 PRINT ' numbers were larger than 500' There are four lines of code that contain errors. 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.

