1
Section B
2 Read this section of program code that should input 50 numbers and then output the average.
1 TOTAL = 0
2 loop for COUNTER = 1 TO 50
3 input NUM
4 TOTAL = TOTAL + 1
5 COUNTER = COUNTER + 1
6 AVERAGE = TOTAL / COUNTER
7 end loop
8 output AVERAGE
There are four errors in this code.
Locate these errors and suggest code corrections to remove each error.
1 .......................................................................................................................................................
..........................................................................................................................................................
2 .......................................................................................................................................................
..........................................................................................................................................................
3 .......................................................................................................................................................
..........................................................................................................................................................
4 .......................................................................................................................................................
......................................................................................................................................................[4]
Section B
2 Read this section of program code that should input 50 numbers and then output the average.
1 TOTAL = 0
2 loop for COUNTER = 1 TO 50
3 input NUM
4 TOTAL = TOTAL + 1
5 COUNTER = COUNTER + 1
6 AVERAGE = TOTAL / COUNTER
7 end loop
8 output AVERAGE
There are four errors in this code.
Locate these errors and suggest code corrections to remove each error.
1 .......................................................................................................................................................
..........................................................................................................................................................
2 .......................................................................................................................................................
..........................................................................................................................................................
3 .......................................................................................................................................................
..........................................................................................................................................................
4 .......................................................................................................................................................
......................................................................................................................................................[4]