5 A one-dimensional array dataArray[1:20] needs each element set to zero.
- (a)Write a pseudocode routine that sets each element to zero. Use the most suitable loop structure.[3]
- (b)Explain why you chose this loop structure.[1]
Mark scheme
Marking points from the official mark scheme (May/June 2021). The mark or mark type is shown in brackets.
- [1] Use of FOR loop
- [1] Working loop with correct number of Iterations
- [1] Correct assignment
- [1] FOR Count ← 1 TO 20
- [1] dataArray[Count] ← 0
- [1] NEXT (Count)
- [1] (A FOR loop has) a fixed number of repetitions //
- [1] No need to manage the loop counter //
- [1] no need to use another variable for the array index
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 →