Single lesson · Written for AQA GCSE Computer Science (8525)

Two-dimensional arrays – AQA GCSE Computer Science lesson (8525)

Pupils learn to use a two-dimensional array in the class's language and AQA pseudo-code, including nested loops.

Also in a bundle Characters, Images, Sound, Strings and Data Structures – AQA GCSE Computer Science lessons (8525) 11 lessons for £39 · save 11% on buying separately

Lesson 8 of 11 in unit 10.4 Characters, Images, Sound, Strings and Data Structures, taught in Year 10, Spring 2. It answers one big question: How can a program store a table of data?

By the end, pupils can use a two-dimensional array in the class's language and AQA pseudo-code, including nested loops.

The Build (the main task)
Write a program that stores the line-ups in a 2D array (stage 0: Sola, Kai, Mira, Juno; stage 1: Vex, Ode, Tide, Ash; stage 2: Pip, Rue, Zed, Lark), outputs the array element at stage 1, slot 2, then uses nested loops to output every act: the festival's three stages each have four time slots. (6 marks)
Support version
Part-filled code with the 2D array written and the outer loop given.
Challenge
Write a program that stores the ticket counts [[120, 95, 80], [60, 140, 75]] in a 2D array, uses nested loops to add up every element, and outputs the total once. (5 marks) Complete a trace table for this algorithm: r, c, total and the output. (5 marks) Write a program that uses nested loops to output the total number of tickets for each day (each row of the tickets array) on its own line. (6 marks)
Real-world link
The festival's three stages and their time slots.
Key words
2D array, Array element and Grid, each with a definition, an icon and a common mix-up on the key vocabulary slide.
Misconceptions it tackles
“table[3][1] means column 3, row 1”; “A 2D array is two separate arrays”.
AQA 8525 specification
3.2.6 (data structures: one and two-dimensional arrays and records).

Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.

Pupils need computers for the main task.

Also sold in the Characters, Images, Sound, Strings and Data Structures unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.

Choose your school's Paper 1 language when you buy: C#, Python or VB.NET. You get that language's files: every program, code example, worked answer and programming task is written in it, and lessons with no code are the same in all three. Algorithms are also shown in AQA pseudo-code, as in the exam.

An independent resource written for AQA GCSE Computer Science (8525). It is not endorsed by AQA.

What's included

  • Slide deck (PowerPoint)
  • Lesson plan (Word)
  • Worksheet (Word)
  • Support worksheet with scaffolds (Word)
  • Single-teacher licence: use and adapt it with your own classes
  • Your choice of Paper 1 language: C#, Python or VB.NET

More for GCSE Computer Science (AQA)

See all

Written for the specifications named. Not endorsed by or affiliated with any exam board.