New
New
Year 4

Creating a program that uses loops

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

New
New
Year 4

Creating a program that uses loops

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

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

These resources were created for remote use during the pandemic and are not designed for classroom teaching.

Lesson details

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.


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

Use tracing paper and simple shapes to replicate this activity away from the computer. Encourage pupils to explore how they could create patterns from repeated shapes before they attempt to code patterns.
Teacher tip

Equipment

Software that can run Logo code is required to complete activities. This could be downloaded software such as FMSLogo or online alternatives.

Licence

This content is © Oak National Academy Limited (2025), 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

Download quiz pdf

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]

Assessment exit quiz

Download quiz pdf

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