IGCSE · Practice questions · One-dimensional arrays

Loop through the list.

Six original Cambridge-style questions on one-dimensional arrays, with mark points.

Original questions All questions on this page are original work, written in the Cambridge IGCSE style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

Identifier, index, element.

01
Recall
[3 marks]

Describe what is meant by a one-dimensional array.

  • A data structure with a fixed number of elements under a single identifier. ✓
  • All the elements are of the same data type. ✓
  • Each element is accessed using an index (its position). ✓
02
Write
[3 marks]

Write pseudocode to declare an array Heights to store 20 real values and use a loop to input all 20 values.

  • DECLARE Heights : ARRAY[1:20] OF REAL ✓
  • FOR Index ← 1 TO 20 ... NEXT Index ✓
  • INPUT Heights[Index] inside the loop ✓
03
Write
[4 marks]

The array Prices[1:50] holds 50 prices. Write pseudocode to find and output the lowest price.

  • Lowest ← Prices[1] ✓
  • FOR Index ← 2 TO 50 ✓
  • IF Prices[Index] < Lowest THEN Lowest ← Prices[Index] ✓
  • After the loop: OUTPUT Lowest ✓
04
Trace
[3 marks]

State the values stored in Data and the output.

FOR Index ← 1 TO 4
    Data[Index] ← Index * Index - 1
NEXT Index
OUTPUT Data[2] + Data[4]
  • Data[1] = 0, Data[2] = 3. ✓
  • Data[3] = 8, Data[4] = 15. ✓
  • Output: 3 + 15 = 18 ✓
05
Write
[4 marks]

The array Marks[1:30] holds 30 marks. Write pseudocode to count and output how many marks are 50 or more.

  • Count ← 0 before the loop ✓
  • FOR Index ← 1 TO 30 ✓
  • IF Marks[Index] >= 50 THEN Count ← Count + 1 ✓
  • After the loop: OUTPUT Count ✓
06
Explain
[2 marks]

Explain why storing 30 names in an array is better than using 30 separate variables.

  • Only one identifier is needed, so the code is shorter and easier to read. ✓
  • A loop with the index as the loop variable can process every name with the same statements. ✓

Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.