Cambridge IGCSE Computer Science 0478
Data Representation
Data Transmission
Hardware
Software
The Internet and Its Uses
Automated and Emerging Technologies
Algorithm Design and Problem-Solving
Programming
Programming
Arrays
- 3 things to know
- Paper 2
Overview
Declaring and using one-dimensional and two-dimensional arrays, with loops that read and write every element.
What you need to know
Answer each one before you reveal it.
How is a one-dimensional array declared in pseudocode?
How is a two-dimensional array declared in pseudocode?
Questions from this subtopic
Each one with the model answer underneath.
- 1
What is an array?
Model answer
An array is a data structure that stores a fixed number of items of the same data type under one identifier, each with an index.
- 2
How is a one-dimensional array declared in pseudocode?
Model answer
A one-dimensional array is declared with its bounds and type, for example DECLARE StudentNames : ARRAY[1:30] OF STRING.
- 3
How is a two-dimensional array declared in pseudocode?
Model answer
A two-dimensional array is declared with bounds for rows and columns, for example DECLARE Board : ARRAY[1:3, 1:3] OF CHAR.
- 4
What is a two-dimensional array used for?
Model answer
A two-dimensional array stores data as a table of rows and columns, such as the marks of each student in each test.
- 5
Why are arrays useful?
Model answer
An array stores many related values under one name. A loop can then process every value with only a few lines of code.
- 6
How is a variable used as an index in an array?
Model answer
A loop variable such as Index selects each element in turn, as in StudentNames[Index].
Other ways to work this
The same content, four other ways.
Everything in your subscription
Runs, plus a mode for every other kind of session.
Every question in Programming, on a schedule.
Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.