Skip to content
Technologies · Year 6

Active learning ideas

Branching with 'If-Then-Else'

Learning to code with 'if-then-else' statements is about building computational thinking skills, and active learning helps students internalize this logic. When students actively create, debug, and analyze code, they move beyond memorizing syntax to truly understanding how programs make decisions.

ACARA Content DescriptionsAC9TDI6P02
30–60 minPairs → Whole Class3 activities

Activity 01

Problem-Based Learning60 min · Small Groups

Format Name: Conditional Story Creator

Students use a block-based coding platform to create a simple choose-your-own-adventure story. They write 'if-then-else' statements to present choices to the user and branch the narrative accordingly.

Analyze how 'if-then-else' statements provide two distinct paths for program execution.

Facilitation TipFor the 'Conditional Story Creator' activity using Problem-Based Learning, encourage students to brainstorm multiple potential story branches before coding, embracing the ambiguity of open-ended problem-solving.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Problem-Based Learning45 min · Pairs

Format Name: Debugging Decision Trees

Provide students with pre-written code snippets containing 'if-then-else' errors. In pairs, they must identify the logical flaws and correct the code to achieve the intended program behavior.

Justify the use of an 'else' block in scenarios where a default action is required.

Facilitation TipDuring the 'Debugging Decision Trees' activity with Collaborative Problem-Solving, assign roles within pairs such as 'code reader' and 'error finder' to ensure structured thinking and teamwork.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Problem-Based Learning30 min · Whole Class

Format Name: Real-World Condition Matching

As a whole class, brainstorm everyday scenarios that involve 'if-then-else' logic (e.g., 'If it is raining, then take an umbrella, else wear sunglasses'). Discuss how these decisions are made and translate them into pseudocode.

Construct a program that guides a user through different options using 'if-then-else'.

Facilitation TipIn the 'Real-World Condition Matching' activity, guide the whole class discussion to ensure a wide range of scenarios are explored, reinforcing the universality of conditional logic.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

When teaching 'if-then-else', focus on the concept of program flow and decision-making rather than just the syntax. Use analogies to everyday choices and encourage students to physically trace the path of execution through code. Avoid presenting 'else' as always mandatory; instead, let students discover its purpose through practice.

Successful learners will be able to construct simple programs that use 'if-then-else' to control program flow. They will be able to identify and correct errors in conditional logic and explain real-world examples of this programming concept.


Watch Out for These Misconceptions

  • During 'Debugging Decision Trees', students might think every 'if' needs an 'else'.

    Guide students to observe code snippets where 'if-then' structures exist without an 'else' clause, prompting them to discuss when an 'else' is truly necessary for a default action.

  • During 'Conditional Story Creator', students may believe all parts of an 'if-then-else' structure run.

    Encourage students to test their stories with different inputs, observing that only one code path is executed based on the condition, reinforcing that the program chooses a single branch.


Methods used in this brief