Cambridge O Level Computer Science 2210 · 8.2 Arrays

Q46 · 2210/22/M/J/22 Q3

Worked solution from the Programming Paper 2 Algorithms, Programming and Logic booklet, Part 2 of 3.

Q462210/22/M/J/22original Q3Structured · 5 marks
Question 3 from 2210/22/M/J/22

Worked solution

(a)

Describe the array in these points, any two, plus an example:

A list (one column) of items [1]

All items have the same data type, stored under a single identifier, with an index to find each element [1]

Example declaration: write DECLARE MyArray[1:10] OF INTEGER [1]

(b)

Use a counter as the index of the array [1]

Put the counter in a loop and add 1 each time, so the same code can check every element in turn [1]

KEY IDEAAn array is a list of same-type items with an index, and a loop with a counter can visit each index.
TOTAL 5 marks

Official mark scheme

Mark scheme for 2210/22/M/J/22 question 3
VIDEO
▶ Whole paper

Video solution of the whole paper · by Zafar Ali Khan (ZAK). Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.