Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

Creating a program that uses loops

Lesson details

Learning outcome

I can create a program, using count-controlled loops, to produce a given outcome.

Key learning points

  1. Programs are designed to include count-controlled loops.
  2. Designs are used to write programs.
  3. Programs are improved through debugging.

Keywords

  • Procedure - a named set of commands that can be called multiple times throughout a program

  • Count-controlled loop - a chunk of code that repeatedly runs a section of the program a certain number of times

Common misconception

Repeating a shape many times will always create a pattern.

The turn angle must be correct to form a repeating design. With the wrong choice of value a pattern might not appear.

Teacher tip

Encourage pupils to explore how they could create patterns from repeated shapes before they attempt to code patterns. To scaffold the activities in this lesson, use pencils, tracing paper and simple shapes and follow the commands to draw shapes away from the computer.

Equipment

Pupils need access to a device with software that can execute Logo programs. Examples in this lesson use FMSLogo https://oak.link/fms-logo

Licence

This content is © Oak National Academy Limited (2026), licensed on Open Government Licence version 3.0
except where otherwise stated. See Oak's terms & conditions
(Collection 2).

Lesson video

Loading...

Prior knowledge starter quiz

6 Questions

Q1.
Place these steps for creating a program in order.

1 - decompose the task
2 - write the code
3 - test the program

Q2.
What is a named set of commands that can be reused?

Correct Answer: procedure, a procedure

Q3.
What is a count-controlled loop?

a command that runs only once
Correct answer: a chunk of code that repeats a set number of times
a program that runs without stopping
a type of procedure that cannot be called again

Q4.
What does tracing a program mean?

writing a new program from scratch
deleting parts of a program that don’t work
repeating a program multiple times
Correct answer: following a program line by line to predict what it will do

Q5.
How does changing the value of a repeat command affect a loop?

Correct answer: It changes the number of repetitions.
It has no effect on the loop.
It makes the program stop working.
It creates a new procedure.

Q6.
Correct this command to draw a square: repeat [fd 100 rt 90].

Correct Answer: repeat 4 [fd 100 rt 90]

6 Questions

Q1.
What is a procedure in programming?

a command that runs only once
a loop that repeats forever
Correct answer: a named set of commands that can be called multiple times
a program that cannot be reused

Q2.
What is a count-controlled loop?

a tool for debugging programs
a command that always runs once
a program that runs without stopping
Correct answer: a chunk of code that repeats a set number of times

Q3.
Which of the following is true about debugging?

Debugging always makes programs slower.
Debugging removes all procedures from a program.
Debugging is used only in advanced programs.
Correct answer: Debugging helps find and fix errors in a program.

Q4.
What is the purpose of a program design?

Correct answer: to plan how the program will work before writing it
to write the final program code
to test a completed program
to speed up the program

Q5.
Match each term to its definition.

Correct Answer:procedure,a named set of commands that can be reused

a named set of commands that can be reused

Correct Answer:count-controlled loop,a chunk of code that repeats a set number of times

a chunk of code that repeats a set number of times

Correct Answer:debugging,finding and fixing errors in a program

finding and fixing errors in a program

Correct Answer:turn angle,a command that controls the direction and shape of a pattern

a command that controls the direction and shape of a pattern

Correct Answer:design,a plan for how a program will work

a plan for how a program will work

Q6.
What would be a sensible name for a procedure that draws a triangle?

Correct Answer: triangle

To help you plan your 4 computing lesson on: Creating a program that uses loops, download all teaching resources for free and adapt to suit your pupils' needs...