← ACARA Digital Technologies Years 7–8

Tracing a flowchart whose arrow loops back through a decision

An arrow that returns to a decision diamond. Each time you follow it, add a new row to the trace table so every pass of the loop is recorded, until you take the exit arrow.

Understanding Tracing a flowchart whose arrow loops back through a decision in ACARA Digital Technologies Years 7–8

What it does: The step count <- count + 1 comes before the diamond, so the trace row shows the updated count when the condition is checked. Counting visits to the diamond gives one row for each pass, and the last visit (count 3) fails the test and takes the exit arrow. A trace table keeps a separate row for each pass. A single row that is changed would erase the history, so you could not check the steps or find an error. The No arrow is the exit. You stop adding loop rows and follow it to the next shape, here the output.

Common mistakes: If count starts at 3, the test 3 < 3 is No on the very first visit. The loop-back arrow is never followed. Count should start at 0 so the diamond is visited again and again until count reaches 3. When n is 2, the test 2<2 is false, so the answer is No, not Yes. The exit arrow is taken here instead of another loop-back. It should say No.

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 420–481) and word search (Modules 420–519).

Take this worksheet further — free with Cloodit

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

Learning
Duo
A flowchart arrow goes from a process box back up to a decision diamond. What should you do in your trace table each time you follow this arrow?
Overwrite the old row to save spaceAdd a new row for that pass of the loop
Matches
Trace rows: count 1 | count 2 (loop-back arrow followed, but no row added for the third visit)
↓
A row was missed for a visit to the diamond. Every time the loop-back arrow returns to the diamond, a new row must be added.
Applying
Meanings
Term
loop-back arrow
Meaning
An arrow that returns to a decision diamond. Each time you follow it, add a new row to the trace table so every pass of the loop is recorded, until you take the exit arrow.
Practice
Visit | count | count < 3 | Arrow
Testing
Gaps
Step: ← count + 1
Check Answer
Spots
1START
2Set count to 3

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

The 'Seahorse' badge — Range Rider, 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 flowchart arrow goes from a process box back up to a decision diamond. What should you do in your trace table each time you follow this arrow?
A. Add a new row for that pass of the loop ✓
B. Overwrite the old row to save space
Every time the loop-back arrow returns to the diamond, you add a new row. That way each pass of the loop is recorded.
2. A flowchart has this loop: the diamond asks 'count < 3?', Yes goes to 'count = count + 1', and then the arrow loops back to the diamond. Start with count = 0. How many times is the diamond visited before you take the No exit arrow?
A. 4 times (count is 0, 1, 2 and 3) ✓
B. 3 times (count is 0, 1 and 2)
The diamond is tested with count = 0, 1, 2 and 3. It is tested once more than the number of times the loop body runs. The fourth test fails, so you take the exit.
3. In the same flowchart, 'count < 3?' with count starting at 0. How many times does the box 'count = count + 1' run?
A. 4 times
B. 3 times ✓
The Yes arrow is taken when count is 0, 1 and 2, so the box runs 3 times. The 4th visit to the diamond takes the exit arrow instead.
4. In a flowchart the counter is updated BEFORE the diamond tests it. Which row in the trace table shows the value the diamond actually tests?
A. The row showing the counter before it was updated
B. The row showing the counter after it was updated ✓
If the box 'n = n + 1' comes before the diamond, the diamond tests the new value of n. Record the updated value in the row before reading the Yes or No answer.
5. A student traces a loop-back flowchart. The diamond test is false, so the No arrow leaves the loop. What does this mean for the trace?
A. The exit arrow is reached, so you stop adding loop rows ✓
B. You must go back around the loop one more time
When the test result sends you down the exit arrow, the loop has finished. You carry on to the next shape, such as OUTPUT, and stop adding loop rows.

Match the Pairs

Diamond: count < 3? Yes -> back to the step before → Each time the Yes arrow loops back to the diamond, add a new row to the trace table for that pass
Diamond: count < 3? No -> Output count → The exit arrow: when the test fails, leave the loop and carry on to the output
The counter is updated before the test, so the diamond sees the new value each time it is visited → count <- count + 1 then diamond: count < 3?
The diamond is visited once per pass, plus one final visit that takes the exit arrow → Start count <- 0: visits with count 1, 2, 3 for count < 3?
Trace rows: count 1 | count 2 (loop-back arrow followed, but no row added for the third visit) → A row was missed for a visit to the diamond. Every time the loop-back arrow returns to the diamond, a new row must be added.
count = 3: count < 3? is Yes, so loop back again → The test was read wrongly. 3 < 3 is false, so the No arrow should be taken and the flowchart should exit the loop.

Key Term

loop-back arrow
An arrow that returns to a decision diamond. Each time you follow it, add a new row to the trace table so every pass of the loop is recorded, until you take the exit arrow.

Fill in the Blanks

1. Start: count ← 0 Step: count ← count + 1 Diamond: count < 3 ?
Hint: Type the counter variable that is updated before the diamond tests it.
2. Step: count ← count + 1 Diamond: count < 3 ? Yes → loop back
Hint: Type the relational operator that keeps the loop going while the counter is smaller than the limit.
3. Start: count ← 0. Step: count ← count + 1 Diamond: count = 3 ? Yes → exit Diamond is visited 3 times
Hint: Type the number of times the diamond is reached before the exit arrow is taken.
4. Diamond: count < 3 ? Yes → loop back Each pass of the loop adds a new row
Hint: Type the part of the trace table that is added every time the loop-back arrow is followed.
5. Row 3: count ← 3 Diamond: count < 3 ? No → exit arrow
Hint: Type the answer on the arrow that leaves the loop when the test is false.

Spot the Error

Question 1
A START
B Set count to 3
C Diamond: count < 3?
D Yes: add 1 to count
E Yes: loop back to diamond
F No: exit arrow, OUTPUT count
Line B — If count starts at 3, the test 3 < 3 is No on the very first visit. The loop-back arrow is never followed. Count should start at 0 so the diamond is visited again and again until count reaches 3.
Question 2
A Row 1: n=0, test 0<2 Yes
B Row 2: n=1, test 1<2 Yes
C Row 3: n=2, test 2<2 Yes
D Exit arrow: OUTPUT 2
Line C — When n is 2, the test 2<2 is false, so the answer is No, not Yes. The exit arrow is taken here instead of another loop-back. It should say No.
Question 3
A x <- 0
B x <- x + 1
C Diamond: x <- 3
D Yes: arrow back to line 2
E No: OUTPUT x
Line C — A diamond holds a question with a Yes and a No exit, not an assignment. It should be a test such as x < 3? so the arrow can loop back on Yes and exit on No.
Question 4
A Test: n < 3, n starts at 0
B Yes passes: n=0, n=1, n=2
C No pass: n=3 (exit arrow)
D Diamond visited 3 times
E So the table needs 4 rows
Line D — The diamond is visited three times with Yes (n=0, 1, 2) and once more with No (n=3). That is 4 visits, so 4 rows. It should say 4 times.
Question 5
A Set lives to 2
B Diamond: lives > 0?
C Yes: subtract 1, take exit
D No: exit arrow, OUTPUT lives
Line C — On Yes the flowchart must follow the loop-back arrow to the diamond so another row is added. The exit arrow is only taken on No. It should say loop back.

Student with a class code? Join your class →