Skip to content
Computing · Year 3 · Sequence and Structure: Programming with Sprites · Autumn Term

Conditional Statements: If/Then Logic

Introducing basic conditional logic where actions depend on whether a condition is true or false.

National Curriculum Attainment TargetsKS2: Computing - ProgrammingKS2: Computing - Logical Reasoning

About This Topic

Conditional statements introduce decision-making in programming, a key step beyond simple sequences. In Year 3, students explore 'if-then' logic using sprite-based tools like Scratch Juniors or Blockly. They create programs where a sprite performs an action only if a condition is true, such as changing direction if it touches the edge of the screen or plays a sound if a key is pressed. This aligns with KS2 Computing standards for programming and logical reasoning, answering key questions on how conditions enable decisions and differ from linear sequences.

These concepts foster computational thinking by teaching students to predict program behaviour based on true or false outcomes. Programs become interactive and responsive, mirroring real-world scenarios like traffic lights or games. Comparing conditional programs to sequential ones highlights how logic adds flexibility and problem-solving power, preparing students for nested conditions in later years.

Active learning shines here through immediate visual feedback from running code. When students build, test, and debug simple if-then challenges in pairs or small groups, they grasp abstract logic through trial and error. Collaborative debugging sessions build resilience and deepen understanding as peers explain their conditions.

Key Questions

  1. Explain how an 'if-then' statement allows a program to make decisions.
  2. Compare a program with conditions to one that simply follows a sequence.
  3. Construct a simple program where a sprite changes behavior based on a condition.

Learning Objectives

  • Explain how an 'if-then' statement enables a program to execute different actions based on a condition.
  • Compare the execution flow of a program using conditional statements to one that follows a simple sequence.
  • Construct a simple program where a sprite's behavior changes based on a specific condition being met.
  • Identify the condition and the action within a given 'if-then' programming block.

Before You Start

Basic Sprite Movement and Interaction

Why: Students need to be able to control sprite actions like moving and changing appearance before they can add conditional logic to those actions.

Understanding of Sequential Commands

Why: Students must first grasp that programs execute commands in order before they can understand how conditional statements alter that flow.

Key Vocabulary

Conditional StatementA programming command that performs an action only if a specific condition is true. It's like a rule that the computer follows.
If-Then LogicA fundamental programming concept where a set of instructions (the 'then' part) is executed only when a stated requirement (the 'if' part) is met.
ConditionThe part of an 'if-then' statement that is checked to see if it is true or false. For example, 'if the sprite touches the edge'.
SequenceA series of instructions that are followed one after another in a specific order, without any decision-making involved.

Watch Out for These Misconceptions

Common MisconceptionConditions trigger randomly every time.

What to Teach Instead

Students often overlook that conditions check specific states like position or input. Pair debugging activities reveal patterns in true/false outcomes, helping them define precise conditions through repeated testing and discussion.

Common MisconceptionIf-then statements run all code anyway.

What to Teach Instead

Many think the 'then' part always executes regardless. Hands-on sprite challenges show the else path or no action when false, with group demos clarifying flowcharts to visualise decision branches.

Common MisconceptionPrograms without conditions cannot change.

What to Teach Instead

Children assume sequences lack adaptability. Comparing before-and-after programs in small groups demonstrates how conditions add responsiveness, building confidence through constructing both types side by side.

Active Learning Ideas

See all activities

Real-World Connections

  • Traffic lights use conditional logic: if the light is red, then stop; if the light is green, then go. This ensures safe and orderly movement of vehicles.
  • Video game characters often react to conditions. For example, if a character's health bar reaches zero, then the game ends or the character respawns.

Assessment Ideas

Exit Ticket

Provide students with a simple 'if-then' code block (e.g., 'if touching color blue, then say Hello'). Ask them to draw what the sprite would do if it touched the color blue, and what it would do if it touched the color red.

Discussion Prompt

Present two short programs: one that makes a sprite move forward 10 steps, and another that makes a sprite move forward 10 steps only if the space bar is pressed. Ask students: 'What is the difference in how these programs will run? Which one is more like a set of instructions for making a sandwich, and why?'

Quick Check

During a coding activity, ask students to hold up a green card if they have successfully made their sprite change color when it hits the wall, and a red card if they are stuck. Then, ask them to explain the 'if' part of their code.

Frequently Asked Questions

How do you introduce if-then logic in Year 3 computing?
Start with real-life examples like 'if raining, take umbrella' to make it relatable. Use sprite tools for visual programming: sequence first, then add one condition. Scaffold with templates showing the block structure, gradually releasing to independent construction. This builds from familiar sequencing to decision-making over 2-3 lessons.
What tools work best for conditional statements in Year 3?
Scratch Juniors or Purple Mash offer block-based interfaces ideal for beginners, with drag-and-drop if-then blocks and instant sprite feedback. Avoid text-based coding; focus on visual logic to match developmental stage. Integrate with iPads for easy sharing and whole-class projection.
How can active learning help students understand conditional statements?
Active approaches like pair programming and live demos provide instant feedback, turning abstract true/false logic into observable sprite behaviours. Students debug collaboratively, predicting outcomes and adjusting conditions, which reinforces logical reasoning far better than worksheets. Group challenges encourage explaining code aloud, solidifying concepts through talk and iteration.
How to assess understanding of if-then programs?
Use success criteria: program runs different paths for true/false, sprite responds correctly to two conditions. Observe during creation, review exported projects, and quiz with 'what happens if?' scenarios. Portfolios of before/after code show progress in adding logic to sequences.