Skip to content
Computing · Year 5

Active learning ideas

IF/ELSE Statements

Active learning helps students grasp IF/ELSE statements because decision-making in code mirrors real-world choices. When learners physically act out conditions or debug live examples, abstract logic transforms into tangible understanding, making the concept stick better than passive notes or slides.

National Curriculum Attainment TargetsKS2: Computing - Programming and Algorithms
25–45 minPairs → Whole Class4 activities

Activity 01

Collaborative Problem-Solving35 min · Small Groups

Unplugged: Condition Card Relay

Prepare cards with conditions like 'score > 50' and actions like 'win prize'. In relay, teams sequence cards into IF/ELSE chains on a board, justifying order. Then translate to Scratch code as a group.

Explain how the 'else' block provides a safety net for our program.

Facilitation TipDuring Condition Card Relay, stand at the back to observe where students hesitate, then pause the game to address misunderstandings as a class.

What to look forGive students a small code snippet with an IF/ELSE statement. Ask them to write down what the output will be if the condition is true, and what the output will be if the condition is false.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 02

Pair Programming: Score Quiz

Pairs use Scratch or Blockly to build a three-question quiz storing score in a variable. Add IF/ELSE for pass/fail messages based on final score. Swap and debug partner's code.

Justify why the order of conditional checks is important in a script.

Facilitation TipIn Pair Programming: Score Quiz, circulate to listen for students explaining their code to each other, as verbalizing reasoning deepens understanding.

What to look forPose this scenario: 'Imagine a program that gives a player a bonus point if they collect 10 coins. What happens if they collect 9 coins? How does the ELSE statement help ensure something still happens?'

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 03

Debugging Circuit: Buggy Branches

Set up five laptops with code having IF/ELSE errors like wrong order or missing ELSE. Pairs rotate, fix one bug per station, log fixes, then share solutions whole class.

Design a simple quiz program using selection with IF/ELSE statements.

Facilitation TipFor Buggy Branches, provide only one test case at a time to force students to isolate the bug step-by-step rather than guessing randomly.

What to look forPresent two simple code blocks, one with the IF statement first and one with the ELSE statement first. Ask students to predict which one will run correctly and explain why the order matters for the program's logic.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 04

Collaborative Problem-Solving25 min · Individual

Individual: Flowchart to Code

Students draw flowchart for a simple game choice like 'health < 20? heal or end'. Code it using variables and IF/ELSE, test inputs, refine based on outputs.

Explain how the 'else' block provides a safety net for our program.

Facilitation TipDuring Flowchart to Code, insist students draw arrows between steps before writing code to ensure their logic matches their intended flow.

What to look forGive students a small code snippet with an IF/ELSE statement. Ask them to write down what the output will be if the condition is true, and what the output will be if the condition is false.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

A few notes on teaching this unit

Teach IF/ELSE by starting with concrete examples students can relate to, like game rules or classroom routines, before moving to abstract code. Avoid overwhelming students with nested conditions early; start with single IF/ELSE pairs and build complexity gradually. Research shows that students grasp selection best when they see the direct cause-and-effect of their conditions in real time, so live debugging and unplugged activities are critical.

Successful learning looks like students confidently explaining how different conditions trigger specific code blocks and choosing the right structure for given scenarios. They should also justify their logic during peer discussions and debugging sessions.


Watch Out for These Misconceptions

  • During Condition Card Relay, watch for students treating ELSE as optional or skipping it entirely when passing cards down the line.

    Pause the relay after two rounds and ask, 'What happens if someone’s condition is false but there’s no ELSE card?' Have them test with a 'no ELSE' scenario to see the program stall or miss actions.

  • During Pair Programming: Score Quiz, listen for students arguing that the order of conditions doesn’t matter because 'the computer will figure it out.'

    Give pairs two test cases: one where a general condition (e.g., score > 50) is checked first and one where a specific condition (e.g., score == 100) comes first. Ask them to run both and compare outputs to see why order changes the result.

  • During Flowchart to Code, notice if students draw linear paths instead of branching ones, treating IF/ELSE like a single sequence.

    Have students map a scenario with three outcomes, like a traffic light system, and ask them to draw arrows showing where the flow splits. Point out that each branch must have a clear start and end.


Methods used in this brief