levo

Programming

Arrays

  • 3 things to know
  • Paper 2
Start revising · £5/month

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.

Your recallNot started
Key term

Write pseudocode to total every value in the 2D array Sales[1:4, 1:7]

Key term

How is a one-dimensional array declared in pseudocode?

Key term

How is a two-dimensional array declared in pseudocode?

Questions from this subtopic

Each one with the model answer underneath.

  1. 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. 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. 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. 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. 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. 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.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Data Representation
Data Transmission
Hardware
Software

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

A robot is .
programmableportablehumanoid

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

A nibble is 4 bits. A byte is 8 bits.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

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.