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.
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.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
end ifFill in the Blanks
Spot the Error
Student with a class code? Join your class →