Trace tables and correcting algorithms – AQA GCSE Computer Science lesson (8525)
Pupils learn to trace algorithms to find errors and write the exact corrections.
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 allPupils learn to explain ethical impacts and risks of digital technology for different groups of people, using mobile technologies and wireless networking.
Pupils learn to explain legal impacts and privacy issues of digital technology, including hacking and the balance between privacy and security.
Pupils learn to explain environmental impacts of digital technology, including energy use, materials and e-waste.
Written for the specifications named. Not endorsed by or affiliated with any exam board.