Computer Science · May / June 2021 · Paper 22 · Question 5
0478
As printed in the paper
The question as text
A one-dimensional array dataArray[1:20] needs each element set to zero.
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
5(a)[3]
One mark for:
Use of FOR loopWorking loop with correct number of IterationsCorrect assignmentFOR Count ← 1 TO 20
dataArray[Count] ← 0
NEXT (Count)
5(b)[1]
(A FOR loop has) a fixed number of repetitions //
No need to manage the loop counter //
no need to use another variable for the array index
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

