Error: Yes and No branches swapped
The THEN and ELSE paths are the wrong way round, so the algorithm gives the opposite result for every input. Fix it by swapping the two paths or by flipping the condition.
Understanding Error: Yes and No branches swapped in ACARA Digital Technologies Years 7–8
What it does: The THEN path matches the condition being true and the ELSE path matches it being false, so the branches are in the right order. One input per branch shows the pattern. If both traced outputs are the opposite of the expected ones, the branches (or the condition) are swapped. Swapping the paths makes 50 or more give "Pass" and less than 50 give "Fail". Changing the input does not fix the algorithm. Flipping the condition fixes the logic. Using >= 20 for Hot means the paths are now correct without moving them. If it is raining, you need an umbrella. The paths are swapped, so the output is reversed.
Common mistakes: The condition tests the opposite of what is needed, so the paths are swapped. A mark of 80 would output "Fail". It should be IF mark >= pass THEN. The condition is flipped, so 25 degrees outputs "Hot day" and 35 outputs "Cool day". It should be IF temp > 30 THEN.
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 420–481) and word search (Modules 420–519).
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
swapped branchesFill in the Blanks
Spot the Error
Student with a class code? Join your class →