← VCE Pseudocode

while loop

A loop that repeats its instructions for as long as the given condition remains true, checked before each repetition

Understanding while loop in VCE Pseudocode

What it does: This description matches a WHILE loop, a condition-checked loop. DO comes after the condition and marks where the repeated instructions begin. DO follows the condition and introduces the instructions that repeat. END WHILE marks the end of the loop block in VCAA pseudocode. The closing keyword is written as two words: END WHILE. If the condition is false at the start, the loop body never executes. VCAA pseudocode uses the arrow ← for assignment, not the equals sign.

Common mistakes: A WHILE loop must be closed with END WHILE, not END LOOP. VCAA pseudocode uses DISPLAY to output a value, not PRINT.

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 a WHILE loop repeat its instructions for as long as a condition remains true?
TrueFalse
Matches
count ← 0 WHILE count < 3 DO DISPLAY count count ← count + 1 ENDWHILE
↓
The closing keyword should be written as END WHILE, not ENDWHILE
Applying
Meanings
Term
WHILE condition DO
Meaning
A loop that repeats its instructions for as long as the given condition remains true, checked before each repetition
Practice
BEGIN
Testing
Gaps
WHILE count <= 5
Check Answer
Spots
4 count ← count + 1
5END LOOP

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

The 'Gazelle' badge — Tuple Sprinter, 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 a WHILE loop repeat its instructions for as long as a condition remains true?
A. False
B. True ✓
A WHILE loop keeps repeating as long as its condition evaluates to true.
2. Which keyword marks the start of the repeated instructions in a WHILE loop?
A. THEN
B. DO ✓
DO follows the condition and introduces the instructions that repeat.
3. Should a WHILE loop be closed with END WHILE?
A. Yes ✓
B. No
END WHILE marks the end of the loop block in VCAA pseudocode.
4. Is ENDWHILE written as one word in VCAA pseudocode?
A. False ✓
B. True
The closing keyword is written as two words: END WHILE.
5. Is the WHILE loop's condition checked before or after the first repetition?
A. Before ✓
B. After
A WHILE loop checks its condition before running the instructions, even the first time.

Match the Pairs

WHILE count <= 5 DO → Starts a loop that repeats while the condition stays true
END WHILE → Closes a WHILE loop block
A structure that repeats instructions while a condition remains true → WHILE loop
The keyword that introduces the repeated instructions after the condition → DO
count ← 0 WHILE count < 3 DO DISPLAY count count ← count + 1 ENDWHILE → The closing keyword should be written as END WHILE, not ENDWHILE
n ← 1 WHILE n <= 5 DO DISPLAY n n = n + 1 END WHILE → Assignment should use ←, not =

Key Term

WHILE condition DO
A loop that repeats its instructions for as long as the given condition remains true, checked before each repetition

Fill in the Blanks

1. WHILE count <= 5 DO
Hint: Type the keyword that marks the start of the repeated instructions
2. WHILE count <= 5 DO DISPLAY count END WHILE
Hint: Type the keywords that close the loop
3. WHILE count <= 5 DO
Hint: Type the keyword that starts a condition-checked loop
4. WHILE x > 0 DO
Hint: Type the keyword that comes after the condition
5. A WHILE loop continues to repeat while its condition remains true
Hint: Type the word describing the state the condition must be in for the loop to keep running

Spot the Error

Question 1
A count ← 1
B WHILE count <= 5 DO
C DISPLAY count
D count ← count + 1
E END LOOP
Line E — A WHILE loop must be closed with END WHILE, not END LOOP.
Question 2
A x ← 10
B WHILE x > 0 DO
C PRINT x
D x ← x - 1
E END WHILE
Line C — VCAA pseudocode uses DISPLAY to output a value, not PRINT.
Question 3
A total ← 0
B WHILE total < 100
C total ← total + 10
D END WHILE
Line B — The WHILE condition is missing DO — it should read WHILE total < 100 DO.
Question 4
A n ← 1
B WHILE n <= 5 DO
C DISPLAY n
D n = n + 1
E END WHILE
Line D — Assignment in pseudocode uses ←, not =.
Question 5
A WHILE score < 100
B score ← score + 10
C DISPLAY score
D END WHILE
Line A — The WHILE condition is missing DO — it should read WHILE score < 100 DO.

Student with a class code? Join your class →