Multiple alternatives with nested if blocks
An if-else block placed inside the else part of another if-else block. The program checks one condition at a time, in order, so it can choose between three or more alternatives.
Understanding Multiple alternatives with nested if blocks in Years 5–6 Creating Digital Solutions
What it does: Checking score > 89 first means high scores stop at A. If score > 69 were first, a score of 95 would wrongly get a B. The nested if-else block in the else part is how a visual program builds the ELSE IF step from the written algorithm. A single if-else only has two paths. Putting a second if-else inside the else gives a third path. The program checks one condition at a time, in order. 85 is more than 49, so it stops at 'B' and never checks for 'A'. Three alternatives need two decisions. The first if-else picks A or not. The nested one picks B or C.
Common mistakes: The first check is for scores over 89, so this branch must say A, the top grade. It should be say A. The inner check uses < so it would say Warm for cold days. It should be temp > 19 to match the band between 20 and 29.
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 51–60) and word search (Modules 41–74).
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
nested if-elseFill in the Blanks
Spot the Error
Student with a class code? Join your class →