Loops – Year 7 Computing lesson
Pupils learn to spot repeated instructions in an algorithm and replace them with a repeat or forever loop to make the program more efficient.
Lesson 4 of 6 in unit 7.2 Algorithms and Block Programming, taught in Year 7, Autumn 2. It answers one big question: How do loops save us from repeating ourselves?
By the end, pupils can spot repeated instructions in an algorithm and replace them with a repeat or forever loop to make the program more efficient.
- The Build (the main task)
- Write a looped version of the guard's nine-block patrol script that uses fewer blocks, then change it so the guard patrols for ever.
- Support version
- Parsons problem: the blocks of the looped script are jumbled, with one extra block that is not needed.
- Challenge
- Explain why the loop version is more efficient than copying the blocks out 20 times.
- Real-world link
- Traffic lights run the same cycle all day and a recipe says 'stir until thick'; in the mini game, a loop makes a guard patrol the maze for ever.
- Key words
- Iteration, Loop and Efficient, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “A loop repeats every block in the script, including the blocks after it”; “Copying the same blocks out again and again is just as good as using a loop”.
- National Curriculum
- NC1 (design, use and evaluate abstractions that model real-world problems and physical systems); NC2 (key algorithms (e.g. searching and sorting); compare alternative algorithms); NC3 (two or more languages, at least one textual; data structures; modular programs with procedures or functions).
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 Algorithms and Block Programming unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
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 KS3 Computing
See allPupils learn to use decomposition, abstraction and algorithmic thinking to solve Bebras-style puzzles and explain their method.
Free sample lessonPupils learn to complete the 45-minute UK Bebras Challenge on their own, choosing a thinking tool for each task.
Free sample lessonWhy does the order of instructions matter? One complete Year 7 Computing lesson with slides, worksheets and a lesson plan.
Free sample lessonWritten for the specifications named. Not endorsed by or affiliated with any exam board.