Level 2

If Else

Level 2 · Chapter 10

What this lesson follows

CSTA K–12 Computer Science Standards (2017)

Algorithms & Programming · Grades 3–5

Use events, loops and if-then in one program.

Code 1B-AP-10Read the official text

Also practised: 1B-AP-15

Common Core State Standards for Mathematics

Number & Operations — Fractions · Grade 3

See a fraction as a number on the line.

Code 3.NF.A.3Read the official text

The short lines are our own words. We matched this lesson to these standards ourselves; the standards' owners have not reviewed or endorsed this course.

Common Core State Standards © 2010 National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

Today you will run different code depending on a condition.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 1B
✦ CSTA 1B-AP-10 · CSTA 1B-AP-15 · ISTE 1.5.a · Standards
🎯 I canrun different code depending on a condition
🧩 New blocks1 block
📝 New words6 words
⏱ Lesson time~35 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students may use plain if instead of if/else and expect the else branch to run — clarify that plain if has no else part.
  • Students may think only one branch runs per click, not per loop iteration — run the forever loop to show the switching behavior.
  • Some students confuse the top branch (true) with the bottom branch (false/else).

🎯 Differentiation

🐢 Struggling: Color-code the two branches on a printed sheet: green for true branch, red for else branch. Student traces the cat's position by color before building.

🚀 Advanced: Nest a second if/else inside the else branch — three possible outcomes (edge, near edge, far from edge).

💡 During the lesson

  • Warm-UpAsk students: "What does a stoplight do when a car comes?" (Green = go, red = stop.) Ask: "Is there ever a third option for the car?" (No — always one of two.) Connect: if/else in Scratch works the same way. Always one answer. if/else is a two-way 2️⃣ block: the cat does one path or the other.
    Point to each frame. Ask: "Does the cat stay quiet in any frame?" (No — it always says something.) Ask: "What is different between frame 4 and frame 5?" (Different words.) Tell students: "That is if/else — always one of two things."
  • Try ItWalk students through one change at a time. After Experiment 1, ask: "What is the cat missing now?" (An answer for NOT at edge.) After Experiment 2, ask: "Does the cat still always do something?" (Yes — turn AND say.) After Experiment 3, ask: "Did we delete the else branch?" (No — we just put a different block inside it.) Reinforce: the else branch can hold any blocks, not only say blocks.
  • PlanDo the first box together. Pick, then watch both stages. "Move, forever — it walks on and on. At the edge? — the check. Yes: At edge! Else: Moving..." Ask: "Which box is the fork?" (At the edge?) Connect to the two if/else branches.
  • BuildShow students that the if/else block is taller than the plain if block — it has two sections. Walk the room to check that students placed the say blocks in the correct branches. A common error is putting both say blocks in the top branch. Run the project with students watching the say bubbles.