← VCE Pseudocode

Reading and tracing complex pseudocode

The exact sequence in which an algorithm's lines run, followed step by step to trace its behaviour.

Understanding Reading and tracing complex pseudocode in VCE Pseudocode

What it does: The DISPLAY statement is guarded by the IF condition. Tracing is the technique of manually stepping through code. A nested loop starts fresh every time the outer loop moves on. The inner loop variable j completes its full range before i changes. The DISPLAY statement only executes when j equals 2. Following each step by hand reveals exactly what gets displayed. Skipping lines can lead to an incorrect trace of the algorithm. This is exactly what execution order means.

Common mistakes: DISPLAY i does run - whenever j equals 2. The inner code runs inside the outer loop, not before it.

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 11–28) and word search (Modules 1–28).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Does tracing follow an algorithm's lines in execution order?
YesNo
Matches
The inner loop never resets between outer passes
↓
Wrong - the inner loop restarts every outer pass
Applying
Meanings
Term
Execution order
Meaning
The exact sequence in which an algorithm's lines run, followed step by step to trace its behaviour.
Practice
BEGIN
Testing
Gaps
The outer loop runs from 1 to
Check Answer
Spots
2The inner loop runs 2 times
3DISPLAY i never runs at all

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

The 'Silverback Gorilla' badge — Savannah Master, 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. Does tracing follow an algorithm's lines in execution order?
A. Yes ✓
B. No
Tracing means stepping through the code exactly as it runs.
2. Does the inner loop reset each time the outer loop advances?
A. No
B. Yes ✓
A nested loop starts fresh every time the outer loop moves on.
3. In this example, does j change faster than i?
A. No
B. Yes ✓
The inner loop variable j completes its full range before i changes.
4. Does DISPLAY i run only when the IF condition is true?
A. Yes ✓
B. No
The DISPLAY statement only executes when j equals 2.
5. Can tracing help predict an algorithm's final output?
A. Yes ✓
B. No
Following each step by hand reveals exactly what gets displayed.

Match the Pairs

Execution order → The exact sequence in which an algorithm's lines run
FOR j FROM 1 TO 2 → The inner loop that resets each outer pass
Runs only when j equals 2 → DISPLAY i
Following code by hand to predict its output → Tracing
The inner loop never resets between outer passes → Wrong - the inner loop restarts every outer pass
Tracing can skip lines to save time → Wrong - tracing must follow every line in order

Key Term

Execution order
The exact sequence in which an algorithm's lines run, followed step by step to trace its behaviour.

Fill in the Blanks

1. The outer loop runs from 1 to 3
Hint: Type the final value of the outer loop counter.
2. The inner loop runs from 1 to 2
Hint: Type the final value of the inner loop counter.
3. DISPLAY i runs when j = 2
Hint: Type the comparison operator used to check equality.
4. Trace tables help follow execution
Hint: Type the word for tracking each step in order.
5. Nested loops run the inner code repeatedly
Hint: Type the word for the loop found inside another loop.

Spot the Error

Question 1
A The outer loop runs 3 times
B The inner loop runs 2 times
C DISPLAY i never runs at all
Line C — DISPLAY i does run - whenever j equals 2.
Question 2
A FOR i FROM 1 TO 3
B FOR j FROM 1 TO 2
C IF j = 2 THEN
D This runs before the outer loop
Line D — The inner code runs inside the outer loop, not before it.
Question 3
A i counts the outer passes
B j never resets each outer pass
C j counts the inner passes
Line B — j does reset to 1 at the start of each outer pass.
Question 4
A DISPLAY i shows j's value
B IF j = 2 THEN checks a value
C DISPLAY i shows i's value
D j resets each outer pass
Line A — DISPLAY i shows the value of i, not j.
Question 5
A The algorithm has two loops
B One loop is nested inside another
C j resets on each outer pass
D DISPLAY runs when j equals 2
E Tracing ignores loop order
Line E — Tracing must follow the exact order the loops execute in.

Student with a class code? Join your class →