levo

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.

Your recallNot started
Key term

What does each of SELECT, FROM and WHERE do in an SQL query?

Key term

What is an array?

Key term

Why is an array described as a static, fixed-length data structure?

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 holds several items of the same data type under one name. Each item is reached by its index.

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

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Systems Architecture
Memory and Storage
Computer Networks, Connections and Protocols
Network Security

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A bit is the unit of data.
smallestlargestmain

Blank Blitz makes facts automatic

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

AThe sum 0 + 0 is 0, and 0 + 1 is 1.
BThe sum 1 + 1 is 0 carry 1.
CThe sum 1 + 1 + 1 is 1 carry 1.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

Integer means a whole number with no fractional part.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

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

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.