OCR GCSE Computer Science J277
Systems Architecture
Memory and Storage
Computer Networks, Connections and Protocols
Network Security
Systems Software
Ethical, Legal, Cultural and Environmental Impacts of Digital Technology
Algorithms
Programming Fundamentals
Producing Robust Programs
Programming Languages and Integrated Development Environments
Programming Fundamentals
Arrays, records and SQL
- 3 things to know
- J277/02
Overview
One- and two-dimensional arrays indexed from zero, records and fields, and SELECT, FROM and WHERE queries on a small table with worked results.
What you need to know
Answer each one before you reveal it.
What is an array?
Why is an array described as a static, fixed-length data structure?
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 holds several items of the same data type under one name. Each item is reached by its index.
- 2
Why is an array described as a static, fixed-length data structure?
Model answer
An array's size is set when it is declared and cannot change while the program runs. The programmer must decide the number of elements in advance.
- 3
How many elements does array teams[6] create, and what are its first and last indexes?
Model answer
The declaration creates 6 elements. The indexes run from 0 to 5 because arrays are indexed from 0.
- 4
After array scores = [12, 7, 19, 4], what is scores[2]?
Model answer
The value of scores[2] is 19. Index 0 holds 12, so index 2 is the third item.
- 5
After array scores = [12, 7, 19, 4], what does scores[0] = scores[1] + scores[3] do?
Model answer
The line stores 11 in scores[0]. The values 7 and 4 are added, and the result replaces the 12.
- 6
What is a two-dimensional (2D) array?
Model answer
A 2D array stores data in a grid of rows and columns. Each element is reached by two indexes, such as board[1, 0].
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Programming Fundamentals, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.