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

Trace tables and correcting algorithms – AQA GCSE Computer Science lesson (8525)

Pupils learn to trace algorithms to find errors and write the exact corrections.

Also in a bundle Impacts of Technology and Full Papers – AQA GCSE Computer Science lessons (8525) 11 lessons for £39 · save 11% on buying separately

Lesson 7 of 11 in unit 11.3 Impacts of Technology and Full Papers, taught in Year 11, Spring 1. It answers one big question: How do you find and fix an error you can't see?

By the end, pupils can trace algorithms to find errors and write the exact corrections.

The Build (the main task)
Complete the trace table for the algorithm. You may not need every row. (5 marks) The algorithm should output 9 and 8. Identify the line number of the logic error and write the corrected line. (2 marks)
Support version
The trace table's first rows filled and the loop columns highlighted.
Challenge
The report algorithm is changed so line 3, busTotal ← 0, is moved above line 2. Line 4 is corrected to FOR j ← 0 TO 2. Complete a trace table for the new algorithm and state the two outputs. (5 marks) Before the error in the report was found, Northgate's tester ran it once. State test data – values for takings – that would have shown the logic error, and the expected output for that data. Explain why your data reveals the error. (5 marks) Write an AQA pseudo-code algorithm that uses nested FOR loops to output the total takings for each of the 3 buses in a 3 × 4 array takings, then the overall total for all the buses. (6 marks)
Real-world link
Finding the bug in TapRide's daily fare report.
Key words
Trace table, Logic error and Correct, each with a definition, an icon and a common mix-up on the key vocabulary slide.
Misconceptions it tackles
“The error is on the line where the wrong output appears”; “A correction can be described in words”.
AQA 8525 specification
3.1.1; 3.2.11.

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 can do it all on paper.

Also sold in the Impacts of Technology and Full Papers unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.

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

More for GCSE Computer Science (AQA)

See all

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