Working out the purpose of an algorithm
What the whole algorithm achieves. Follow the steps, check what it SHOWS and read the variable names for clues, then say it in one sentence.
Understanding Working out the purpose of an algorithm in ACARA Digital Technologies Years 5–6
What it does: The name lapsRun hints that the algorithm counts laps, and the loop stops at 10 laps. The messages shown are about voting, so the purpose is to check if someone is old enough to vote. The SHOW step displays total, and total is built by adding every price. So the algorithm adds up prices. Purpose is about the whole algorithm. One step is only a small part of it. Only present students add 1 to count, and count is what gets shown. So it counts students who are present. Variable names are clues. highScore only changes when a bigger score appears, so it stores the best score.
Common mistakes: The algorithm adds up prices, so line 2 should ASK price. It asks for cost, but line 3 uses price, so the total would never be worked out properly. The variable is called steps, not step. The purpose is to count 10 steps and show the answer, so line 4 should be SHOW steps.
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.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
purposeFill in the Blanks
Spot the Error
Student with a class code? Join your class →