← Years 5–6 Creating Digital Solutions

Designing an algorithm for a known user's need

Start with the user's problem, list the steps the solution must do, then add any decisions and repeats. Think about what the user puts in and needs out, and test the steps with them.

Understanding Designing an algorithm for a known user's need in Years 5–6 Creating Digital Solutions

What it does: An IF ... THEN ... ELSE adds a decision to the steps, which is the next part of designing an algorithm after the steps are listed. A REPEAT loop is added to the listed steps when something must happen more than once. Start with the main steps in order. Then add IF decisions and REPEAT loops only where the user's need calls for them. Inputs are what the user puts in, like typing or tapping. The score shown on screen is an output. User feedback helps you improve the algorithm. Designers change the steps and test again. Inputs are the information the known user gives the solution, so the algorithm must plan for them.

Common mistakes: An IF decision needs the word THEN after its condition. The line should be IF choice = salad THEN so Mia's lunch price is only changed when she picks salad. The coach's input is stored in laps, but this line uses lap, a name that was never set up. It should be REPEAT UNTIL count = laps so the loop stops at the number the coach gave.

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
Maya's problem statement says she needs a way to remember to feed her class fish each day. What should you do FIRST when designing an algorithm for her?
Add a loop that repeats foreverRead her problem statement and list the steps the solution must do
Matches
1. Show the answer 2. Ask the user for their number
↓
The steps are in the wrong order. The algorithm shows the answer before it collects the input it needs, so the fix is to ask for the number first.
Applying
Meanings
Term
design an algorithm
Meaning
Start with the user's problem, list the steps the solution must do, then add any decisions and repeats. Think about what the user puts in and needs out, and test the steps with them.
Practice
1. Ask the student for the book title
Testing
Gaps
pet
Check Answer
Spots
2price ← 0
3IF choice = salad

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

The 'Tree Frog' badge — Leap of Logic, 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. Maya's problem statement says she needs a way to remember to feed her class fish each day. What should you do FIRST when designing an algorithm for her?
A. Read her problem statement and list the steps the solution must do ✓
B. Add a loop that repeats forever
Good design starts with the user's problem. Once you know what the solution must do, you can list the steps.
2. Which is the better way to build an algorithm for a known user?
A. List the steps first, then add decisions and repeats where needed ✓
B. Add every decision and loop first, then think about the steps
Start with the main steps in order. Then add IF decisions and REPEAT loops only where the user's need calls for them.
3. A student is designing a quiz app for Sam. Which one is an INPUT the user gives?
A. The app shows Sam his final score
B. Sam types in his answer to a question ✓
Inputs are what the user puts in, like typing or tapping. The score shown on screen is an output.
4. Zara needs her library app to show which books are due back this week. What is the OUTPUT she needs?
A. A list of the books due back this week ✓
B. The name of the book she types into the search box
Outputs are what the user needs to get out of the solution. Typing a name is an input.
5. Your algorithm has to do something different if the user is under 8 years old. What should you add?
A. A loop: REPEAT 8 TIMES
B. A decision: IF age < 8 THEN ... ELSE ... ✓
When the steps change depending on a condition, you need a decision (branching), not a loop.

Match the Pairs

INPUT: user types their name → An input the user gives to the algorithm, which the steps can then use
OUTPUT: show 'Bus leaves at 8:15' → An output the user needs, shown to them when the algorithm finishes
After listing the steps, add a decision if the user's problem needs a choice → IF homework is done THEN play ELSE study
Add a repeat when the user's problem needs the same steps again and again → REPEAT 5 TIMES: water the plant
1. Show the answer 2. Ask the user for their number → The steps are in the wrong order. The algorithm shows the answer before it collects the input it needs, so the fix is to ask for the number first.
Design the steps. Finish. (never tried with the user) → The algorithm was never tested with the user. The designer should follow the steps with the user and check they solve the problem, then fix any mistakes.

Key Term

design an algorithm
Start with the user's problem, list the steps the solution must do, then add any decisions and repeats. Think about what the user puts in and needs out, and test the steps with them.

Fill in the Blanks

1. INPUT pet OUTPUT "Time to feed " + pet
Hint: Type the keyword for the step where the user gives the system information.
2. INPUT homework OUTPUT "Time for a break!"
Hint: Type the keyword for the step where the system shows the user what they need.
3. INPUT minutes IF minutes < 10 THEN OUTPUT "Too short"
Hint: Type the keyword that starts a decision in the algorithm.
4. REPEAT 3 TIMES OUTPUT "Drink some water"
Hint: Type the keyword that makes the steps below it run again.
5. IF age < 8 THEN OUTPUT "Easy level" ELSE OUTPUT "Hard level"
Hint: Type the keyword for the other path when the condition is not true.

Spot the Error

Question 1
A INPUT choice FROM Mia
B price ← 0
C IF choice = salad
D price ← 5
E END IF
F OUTPUT price
Line C — An IF decision needs the word THEN after its condition. The line should be IF choice = salad THEN so Mia's lunch price is only changed when she picks salad.
Question 2
A INPUT laps FROM coach
B count ← 0
C REPEAT UNTIL count = lap
D count ← count + 1
E OUTPUT count
Line C — The coach's input is stored in laps, but this line uses lap, a name that was never set up. It should be REPEAT UNTIL count = laps so the loop stops at the number the coach gave.
Question 3
A OUTPUT steps to Ravi
B ASK Ravi to try the steps
C NOTE what confuses Ravi
D IGNORE what confuses Ravi
E TEST again with Ravi
Line D — Testing with the user only helps if you use what you learn. After noting what confuses Ravi, the step should be to FIX the confusing steps, not ignore the problem.
Question 4
A INPUT subject FROM Zoe
B INPUT date FROM Zoe
C reminder ← subject + date
D OUTPUT reminder
Line B — This is a trick check: the correct program has INPUT date FROM Zoe on line 2, because the date is something Zoe gives the solution. Using OUTPUT would show a date instead of collecting it.
Question 5
A INPUT weather FROM Ben
B IF weather ← rain THEN
C OUTPUT 'Wear a coat'
D ELSE
E OUTPUT 'Wear a hat'
F END IF
Line B — A condition compares values, so it needs = and not the assignment arrow ←. It should be IF weather = rain THEN so Ben gets the right advice for the weather.

Student with a class code? Join your class →