Single lesson · Key Stage 3

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.

Also in a bundle Algorithms and Block Programming – Year 7 Computing lessons 6 lessons for £20 · save 16% on buying separately

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 all

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