← ACARA Digital Technologies Years 7–8

Drawing a decision inside a loop in a flowchart

A decision diamond on the loop path is asked on every pass. Its Yes and No paths both rejoin before the arrow returns to the loop test.

Understanding Drawing a decision inside a loop in a flowchart in ACARA Digital Technologies Years 7–8

What it does: The count update comes after the paths merge, so it runs on every pass whichever way the decision went. The loop test is a diamond too. The body, including the inner decision, loops back to it each time. Both paths must rejoin so the flow can carry on and return to the loop test. The diamond is drawn once but asked on every pass, so 5 passes means 5 questions. If the No path never rejoins, the loop stops early on some passes. Both Yes and No should meet before the arrow back.

Common mistakes: Every arrow leaving a decision diamond needs a Yes or No label. Line 2 should be D -->|Yes| H[Say lower]. A decision must be drawn as a diamond, which is { } in Mermaid. D[high?] makes a plain step box. It should be D{high?}.

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 365–411) and word search (Modules 331–411).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A decision diamond is drawn inside a loop. How often is it asked?
On every pass through the loopOnly on the first pass
Matches
Yes path of the decision loops back to the loop test, but the No path ends the flowchart
↓
Only one path returns to the loop. The paths must both rejoin and then go back to the loop test together.
Applying
Meanings
Term
decision inside a loop
Meaning
A decision diamond on the loop path is asked on every pass. Its Yes and No paths both rejoin before the arrow returns to the loop test.
Practice
SET count TO 0
Testing
Gaps
A decision in a flowchart is a
Check Answer
Spots
1L{n < 5?} -->|Yes| D{high?}
2D --> H[Say lower]

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

The 'Zebra' badge — Pattern Matcher, 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 decision diamond is drawn inside a loop. How often is it asked?
A. Only on the first pass
B. On every pass through the loop ✓
The diamond sits on the loop path, so each time the loop goes round, the question is asked again.
2. In a flowchart, a decision diamond is inside a loop. What should happen to its Yes and No paths?
A. Both rejoin into one arrow before the loop test ✓
B. Each one goes to its own End shape
Both paths must rejoin so the flow can carry on and return to the loop test.
3. Which drawing is correct for a loop with a decision inside?
A. Loop test, Yes, decision, then a joined arrow back to the loop test ✓
B. Loop test, decision, then the Yes arrow back to the loop test and the No arrow stops
If the No path stops, the loop cannot go round again when the answer is No. Both paths must reach the return arrow.
4. In a higher or lower game flowchart, the loop test is 'Guess correct?' and the decision is 'Guess too high?'. Where does the 'Guess too high?' diamond go?
A. On the loop path, after the guess is entered ✓
B. Outside the loop, after the game ends
The game must check each guess, so the diamond sits inside the loop and is asked on every guess.
5. A counter 'guesses = guesses + 1' is added to the higher or lower flowchart. Where is it best drawn?
A. Only on the Yes path
B. After the decision, once Yes and No have rejoined ✓
Placing the counter update after the paths rejoin means every guess is counted, whether the answer was Yes or No.

Match the Pairs

Diamond: Is guess = secret? → A decision diamond inside the loop body that is asked again on every pass through the loop
Yes path and No path both join, then arrow back to loop test → Both branches rejoin at one point before the flow returns to the loop condition
In a higher or lower game, the counter goes up after the decision, once both paths have rejoined → Is guess too high? -> Yes: Show Lower / No: Show Higher -> join -> count <- count + 1
The loop test asks if the game should keep going, and the arrow from the end of the loop body returns to it → Diamond: guess <> secret? -> Yes: Ask for guess, decision, join, back to this diamond
Yes path of the decision loops back to the loop test, but the No path ends the flowchart → Only one path returns to the loop. The paths must both rejoin and then go back to the loop test together.
Count <- count + 1 is placed on the Yes path only, so it is skipped when the answer is No → The counter update is on one branch only, so it does not run on every pass.

Key Term

decision inside a loop
A decision diamond on the loop path is asked on every pass. Its Yes and No paths both rejoin before the arrow returns to the loop test.

Fill in the Blanks

1. A decision in a flowchart is a diamond
Hint: Type the name of the shape used for a decision.
2. Guess too high? Yes: Say Lower Guess too high? No: Say Higher
Hint: Type the label on the other path leaving the diamond.
3. Say Lower or Say Higher count ← count + 1 Arrow back to the loop test
Hint: Type the variable that counts the guesses, updated after the decision.
4. Both paths rejoin before the arrow back
Hint: Type the word meaning the Yes and No paths join together again.
5. The diamond is asked on every loop pass
Hint: Type the word that says how often the decision is asked.

Spot the Error

Question 1
A L{n < 5?} -->|Yes| D{high?}
B D --> H[Say lower]
C D -->|No| W[Say higher]
D H --> C[n = n + 1]
E W --> C
F C --> L
Line B — Every arrow leaving a decision diamond needs a Yes or No label. Line 2 should be D -->|Yes| H[Say lower].
Question 2
A L{go < 5?} -->|Yes| D[high?]
B D -->|Yes| H[Say lower]
C D -->|No| W[Say higher]
D H --> C[go = go + 1]
E W --> C
F C --> L
Line A — A decision must be drawn as a diamond, which is { } in Mermaid. D[high?] makes a plain step box. It should be D{high?}.
Question 3
A L{q < 5?} -->|No| D{right?}
B D -->|Yes| S[pts = pts + 1]
C D -->|No| X[Show answer]
D S --> N[q = q + 1]
E X --> N
F N --> L
Line A — The Yes exit of the loop test leads into the loop body, where the decision is asked. No leaves the loop. It should be -->|Yes| D{right?}.
Question 4
A L{n < 5?} -->|Yes| D{g > 7?}
B D -->|Yes| H[Say lower]
C D -->|No| W[Say higher]
D H --> L
E W --> C
F C --> L
Line D — The Yes path skips the counter update, so the two paths do not rejoin. Both paths must meet at C[n = n + 1] before returning to the loop test. It should be H --> C[n = n + 1].
Question 5
A L{n < 5?} -->|Yes| D{even?}
B D -->|Yes| E{sum = sum + n}
C E --> C[n = n + 1]
D D -->|No| C
E C --> L
Line B — Adding to sum is a step, so it needs a rectangle, not a diamond. Only questions get a diamond. It should be E[sum = sum + n].

Student with a class code? Join your class →