← Years 5–6 Creating Digital Solutions

Algorithms that use sequence, branching and iteration together

Most algorithms mix steps in order (sequence), decisions (branch) and repeats (loop). When you read an algorithm, you can label each part and explain it in your own words.

Understanding Algorithms that use sequence, branching and iteration together in Years 5–6 Creating Digital Solutions

What it does: IF ... THEN ... ELSE makes a decision. The algorithm follows only one path, so this is a branch. Step 1 is a sequence. REPEAT 3 TIMES is a loop. IF ... THEN inside it is a branch. So all three parts work together. A sequence is steps in order. Repeats are loops, and decisions are branches. REPEAT means the steps run again, so it is a loop.

Common mistakes: The loop must start with REPEAT, not IF. IF is for a decision (branch). It should be REPEAT 5 TIMES so it matches END REPEAT. This branch runs when the age is under 13, so it should show 'Ask a parent first'. 'You can join' belongs in the ELSE branch.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 21–30) and word search (Modules 21–40).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which part of an algorithm is a SEQUENCE?
A step that repeats again and againSteps that happen one after another in order
Matches
REPEAT UNTIL the bin is full: Put in a bottle (labelled as a branch)
↓
This is a loop, not a branch. It repeats a step until a condition is true. It does not choose between paths.
Applying
Meanings
Term
sequence, branch, loop
Meaning
Most algorithms mix steps in order (sequence), decisions (branch) and repeats (loop). When you read an algorithm, you can label each part and explain it in your own words.
Practice
Get the school bag (sequence)
Testing
Gaps
the door is shut THEN
Check Answer
Spots
1SET claps TO 0
2IF 5 TIMES

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Constellation Wolf' badge — Space Legend, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which part of an algorithm is a SEQUENCE?
A. A step that repeats again and again
B. Steps that happen one after another in order ✓
A sequence is steps in order. Repeats are loops, and decisions are branches.
2. Read this step: 'IF it is raining THEN take an umbrella'. What is it?
A. A branch, because it makes a decision ✓
B. A loop, because it repeats
IF ... THEN makes a decision, so it is a branch. Nothing repeats here.
3. Read this step: 'REPEAT 5 times: bounce the ball'. What is it?
A. A loop, because it repeats steps ✓
B. A branch, because it makes a choice
REPEAT means the steps run again, so it is a loop.
4. Which sentence is true about most algorithms?
A. They can only use one of these at a time
B. They often mix sequence, branches and loops ✓
Most algorithms combine ordered steps, decisions and repeats in the one algorithm.
5. An algorithm says: 1. Get out your bag. 2. REPEAT UNTIL the bag is full: add a book. 3. Zip up the bag. Which part is the loop?
A. Step 2, because it repeats until the bag is full ✓
B. Step 3, because it comes last
Step 2 repeats until a condition is true. Steps 1 and 3 each happen once in order.

Match the Pairs

1. Get the bowl 2. Pour in the cereal → A sequence: steps done one after the other in order
REPEAT 5 TIMES: Kick the ball → A loop: a step that is repeated more than once
A branch is a decision that picks which steps to follow → IF it is raining THEN take an umbrella ELSE wear a hat
An algorithm can mix all three parts: a sequence, a branch and a loop → 1. Open the gate 2. REPEAT 3 TIMES: IF dog is hungry THEN feed it
REPEAT UNTIL the bin is full: Put in a bottle (labelled as a branch) → This is a loop, not a branch. It repeats a step until a condition is true. It does not choose between paths.
Steps 1, 2 and 3 are all done in order, so this algorithm has no sequence → Steps done in order ARE a sequence. Every algorithm has a sequence, even when it also has branches and loops.

Key Term

sequence, branch, loop
Most algorithms mix steps in order (sequence), decisions (branch) and repeats (loop). When you read an algorithm, you can label each part and explain it in your own words.

Fill in the Blanks

1. walk to the door IF the door is shut THEN open the door
Hint: Type the keyword that starts a decision (a branch).
2. REPEAT 10 TIMES IF the cup is empty THEN fill the cup
Hint: Type the keyword that makes steps repeat (a loop).
3. REPEAT UNTIL the bag is full IF the apple is ripe THEN pick the apple
Hint: Type the keyword that comes after the condition and leads to the action.
4. IF it is raining THEN take an umbrella ELSE wear a cap
Hint: Type the keyword for the other path when the condition is not true.
5. Step 1: wake up // sequence REPEAT 3 TIMES // loop IF tired THEN sleep // branch
Hint: Type the label for the part that repeats.

Spot the Error

Question 1
A SET claps TO 0
B IF 5 TIMES
C ADD 1 TO claps
D END REPEAT
E SHOW claps
Line B — The loop must start with REPEAT, not IF. IF is for a decision (branch). It should be REPEAT 5 TIMES so it matches END REPEAT.
Question 2
A ASK for the user's age
B IF age < 13 THEN
C SHOW 'You can join'
D ELSE
E SHOW 'You can join'
Line C — This branch runs when the age is under 13, so it should show 'Ask a parent first'. 'You can join' belongs in the ELSE branch.
Question 3
A IF it is dark
B TURN ON the light
C ELSE
D TURN OFF the light
Line A — Every IF decision needs the word THEN after the condition. It should be IF it is dark THEN.
Question 4
A REPEAT 3 TIMES
B IF cup is full THEN
C FILL the cup
D END IF
E END REPEAT
Line B — The branch should only fill the cup when it is empty. Filling a full cup makes no sense. It should be IF cup is empty THEN.
Question 5
A FILL the kettle with water
B SWITCH ON the kettle
C SWITCH OFF the kettle
D POUR water into the cup
Line C — In a sequence the order matters. The kettle must stay on and the algorithm must wait until the water boils. The line should be WAIT UNTIL water boils.

Student with a class code? Join your class →