← ACARA Digital Technologies Years 5–6

Spotting sequence, branching and iteration in everyday systems

The three building blocks of algorithms: steps in order, decisions (IF) and repeats (loops). Traffic lights, self-serve checkouts, automatic doors and alarm apps all use them.

Understanding Spotting sequence, branching and iteration in everyday systems in ACARA Digital Technologies Years 5–6

What it does: Steps listed one after another in a set order are a sequence. Swapping the steps would make the light unsafe. IF ... THEN ... ELSE gives two paths. The checkout picks one path depending on whether the scan worked. Doing the same check over and over is a loop, which is iteration. The ringing keeps repeating until the stop condition is true. Pressing stop is the condition that ends the loop. Branching depends on a condition that can change. Here it is whether the button was pressed. IF ... THEN is a decision, which is branching. The door only opens when someone is there.

Common mistakes: A sequence must keep its steps in order. The light should wait 30 seconds on green before it turns orange. Line 2 should be 'Wait 30 seconds'. This is the branch for when the weight does not match, so the checkout should call a staff member. Printing a receipt here is the wrong action. Line 3 should be ' Call a staff member'.

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 106–119) and word search (Modules 106–132).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A traffic light goes red, then green, then yellow, then back to red, always in that order. Which building block is this?
Branching (a decision)Sequence (steps in order)
Matches
1. Pay for items 2. Scan items 3. Pack bags
↓
The steps are in the wrong order. A checkout sequence must scan the items before the customer pays.
Applying
Meanings
Term
sequence, branching, iteration
Meaning
The three building blocks of algorithms: steps in order, decisions (IF) and repeats (loops). Traffic lights, self-serve checkouts, automatic doors and alarm apps all use them.
Practice
REPEAT FOREVER
Testing
Gaps
IF pedestrian button is pressed
Check Answer
Spots
1Light turns green
2Light turns orange

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

The 'Peregrine Falcon' badge — Operator Ace, 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. A traffic light goes red, then green, then yellow, then back to red, always in that order. Which building block is this?
A. Sequence (steps in order) ✓
B. Branching (a decision)
The lights follow a fixed order of steps, so this is sequence. Nothing is being decided here.
2. A self-serve checkout says: IF the item is not on the scale, THEN ask the shopper to try again. Which building block is this?
A. Branching (a decision) ✓
B. Iteration (a repeat)
IF ... THEN makes the checkout choose between paths. That is branching.
3. An automatic door keeps checking for people, again and again, all day. Which building block does the checking again and again show?
A. Iteration (a repeat) ✓
B. Sequence (steps in order)
Doing the same check over and over is a loop, which is iteration.
4. An alarm app rings every 5 minutes until you press stop. Which part of the algorithm is the repeat?
A. Press the stop button once
B. Ring again every 5 minutes until stop is pressed ✓
The ringing keeps repeating until the stop condition is true. Pressing stop is the condition that ends the loop.
5. An automatic door: IF a person is standing in front of the sensor, THEN open the door. What is the condition?
A. The door opens
B. A person is standing in front of the sensor ✓
The condition is the question that is true or false. Opening the door is the action that happens when it is true.

Match the Pairs

IF someone is at the door THEN open the door → Branching: the automatic door makes a decision and only opens when its condition is true
REPEAT UNTIL alarm is turned off: ring again → Iteration: the alarm app repeats the same step over and over until a condition is met
Sequence: a traffic light changes in the same order every time → 1. Show green 2. Show yellow 3. Show red
Branching: a self-serve checkout takes a different action depending on what happens → IF item is scanned THEN beep ELSE show 'Try again'
1. Pay for items 2. Scan items 3. Pack bags → The steps are in the wrong order. A checkout sequence must scan the items before the customer pays.
Traffic light: IF the light is red THEN go → The branch does the wrong action. When the light is red the cars should stop, not go.

Key Term

sequence, branching, iteration
The three building blocks of algorithms: steps in order, decisions (IF) and repeats (loops). Traffic lights, self-serve checkouts, automatic doors and alarm apps all use them.

Fill in the Blanks

1. IF pedestrian button is pressed THEN turn the traffic light red
Hint: Type the keyword that says what happens when the IF decision is true
2. IF person is near THEN open door ELSE keep door shut
Hint: Type the keyword for the other path when the decision is false
3. 1. Scan item 2. Put item in bag 3. Pay for items
Hint: Type the step number that keeps these steps in the right order
4. REPEAT FOREVER change light to green change light to red
Hint: Type the word that makes the traffic light loop never stop
5. REPEAT UNTIL snooze is pressed ring alarm
Hint: Type the keyword that sets the condition for when the repeat stops

Spot the Error

Question 1
A Light turns green
B Light turns orange
C Light turns orange
D Wait 5 seconds
E Light turns red
Line B — A sequence must keep its steps in order. The light should wait 30 seconds on green before it turns orange. Line 2 should be 'Wait 30 seconds'.
Question 2
A Scan the item
B IF weight does not match THEN
C Print the receipt
D ELSE
E Add item to the bag
Line C — This is the branch for when the weight does not match, so the checkout should call a staff member. Printing a receipt here is the wrong action. Line 3 should be ' Call a staff member'.
Question 3
A REPEAT FOREVER
B IF person is near THEN
C Open the door
D END IF
E Close the door
Line D — Ending the IF early removes the ELSE branch. The door would then close every time, even when a person is near. Line 4 should be ' ELSE'.
Question 4
A Set alarm for 7:00
B REPEAT 2 TIMES
C Play the alarm sound
D Wait 5 seconds
Line B — An alarm app should keep repeating until the user taps Stop. A fixed 2 repeats would end even if you are still asleep. Line 2 should be 'REPEAT UNTIL I tap Stop'.
Question 5
A Check the crossing button
B IF button was pressed
C Light turns red for cars
D END IF
Line B — An IF decision needs the word THEN after its condition. Line 2 should be 'IF button was pressed THEN'.

Student with a class code? Join your class →