← VCE Pseudocode

if-then block

The closing keyword that ends an if-then block in VCAA pseudocode. Every if block must be closed with end if at the same indentation level as the opening if keyword

Understanding if-then block in VCE Pseudocode

What it does: When total is 0 or less, print total is skipped and execution jumps to print "Done" after end if. The print "Done" always runs regardless of the condition. if and end if are both at the outer indentation level. The body x <- x + 1 is indented inside, and end if aligns with if to show the block is closed. VCAA pseudocode uses if condition then to open an if block. The word do is not part of the VCAA pseudocode if-then syntax. end if simply closes the if block. After it, the algorithm continues normally with whatever comes next — whether the condition was true or false.

Common mistakes: print "Positive" is inside the if block but is not indented. The body of an if-then block must be indented to show it belongs inside the block. The line should read print "Positive" with leading spaces. Line 3 is wrong. The if condition on line 2 is missing the then keyword. In VCAA pseudocode an if block must use the form if condition then — the word then is required to open the block body. Line 2 is wrong.

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 1–10) 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
Which keyword is required to open the body of an if block in VCAA pseudocode?
then — written after the conditiondo — written after the condition
Matches
if age >= 18 print "Adult" end if
↓
Wrong — the condition is missing the required `then` keyword. The correct form is `if age >= 18 then` with then after the condition
Applying
Meanings
Term
end if
Meaning
The closing keyword that ends an if-then block in VCAA pseudocode. Every if block must be closed with end if at the same indentation level as the opening if keyword
Practice
Algorithm: check passing score
Testing
Gaps
if score >= 50
Check Answer
Spots
3if n > 0 then
4print "Positive"

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

The 'Sea Turtle' badge — Scope Navigator, 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. Which keyword is required to open the body of an if block in VCAA pseudocode?
A. do — written after the condition
B. then — written after the condition ✓
VCAA pseudocode uses `if condition then` to open an if block. The word `do` is not part of the VCAA pseudocode if-then syntax.
2. How must the body of an if-then block be formatted in VCAA pseudocode?
A. Indented to show it belongs inside the block ✓
B. Left-aligned with no indentation
Indentation is a core VCAA pseudocode convention. The body lines of an if block are indented to visually show they are inside the block and only execute when the condition is true.
3. Which correctly closes an if block in VCAA pseudocode?
A. endif
B. end if ✓
The closing keyword is always written as two words with a space: `end if`. Writing `endif` as one word does not follow VCAA pseudocode convention.
4. What happens when the condition in an if-then block is false?
A. The block body is skipped entirely ✓
B. The block body still executes
An if-then block is single-branch selection. When the condition is false, the entire body between `then` and `end if` is skipped. Execution continues after `end if`.
5. Which is the correct VCAA pseudocode structure for a single-branch if block?
A. if score >= 50 then print "Pass" end if ✓
B. if score >= 50: print "Pass"
VCAA pseudocode uses `then` after the condition and `end if` to close the block. The colon syntax belongs to Python and is not valid in VCAA pseudocode.

Match the Pairs

if score >= 50 then print "Pass" end if → A complete if-then block: condition opens with then, the body is indented, and end if closes the block; the body runs only when score >= 50 is true
if n != 0 then result <- 100 / n print result end if → An if-then block with two body statements — both are indented inside the block and both execute only when n is not equal to zero
The body of an if-then block is skipped entirely when the condition is false — execution jumps to the line after end if → if total > 0 then print total end if print "Done"
end if closes the if block at the same indentation level as the opening if keyword → if x > 0 then x <- x + 1 end if
if age >= 18 print "Adult" end if → Wrong — the condition is missing the required `then` keyword. The correct form is `if age >= 18 then` with then after the condition
if n > 0 then print n end if → Wrong — the body `print n` is not indented. The body of an if-then block must be indented to show it belongs inside the block

Key Term

end if
The closing keyword that ends an if-then block in VCAA pseudocode. Every if block must be closed with end if at the same indentation level as the opening if keyword

Fill in the Blanks

1. if score >= 50 then print "Pass" end if
Hint: Type the keyword that opens the body of an if block in VCAA pseudocode
2. if n > 0 then print n end if
Hint: Type the keyword that begins the closing statement of every if block
3. if age >= 18 then print "Adult" end if
Hint: Type the keyword that begins a single-branch selection block in VCAA pseudocode
4. if total > 100 then discount <- total / 10 end if
Hint: Type the integer divisor that calculates a 10 percent discount from the total
5. if x != 0 then result <- 100 / x end if
Hint: Type the keyword that closes the if block at the same indentation as the opening if

Spot the Error

Question 1
A Algorithm: flag positive
B input n
C if n > 0 then
D print "Positive"
E end if
Line D — `print "Positive"` is inside the if block but is not indented. The body of an if-then block must be indented to show it belongs inside the block. The line should read ` print "Positive"` with leading spaces. Line 3 is wrong.
Question 2
A Algorithm: check speed
B input speed
C if speed > 110
D print "Too fast"
E end if
Line C — The if condition on line 2 is missing the `then` keyword. In VCAA pseudocode an if block must use the form `if condition then` — the word `then` is required to open the block body. Line 2 is wrong.
Question 3
A Algorithm: check age
B input age
C if age >= 18 then
D print "Adult"
E endif
Line E — `endif` is written as one word, which is incorrect in VCAA pseudocode. The closing keyword must be written as two separate words: `end if` with a space between them. Line 4 is wrong.
Question 4
A algorithm: check balance
B input balance
C if balance < 0 then
D print "Overdrawn"
E end if
Line A — The keyword `algorithm` uses a lowercase a. VCAA pseudocode requires the keyword to have a capital A: `Algorithm: check balance`. Line 0 is wrong.
Question 5
A Algorithm: check temp
B input temp
C if temp then > 30
D print "Hot"
E end if
Line C — `if temp then > 30` places `then` in the wrong position. The correct structure is `if condition then` — the condition comes before `then`. The line should read `if temp > 30 then`. Line 2 is wrong.

Student with a class code? Join your class →