Level 3

Compare Numbers

Level 3 · Chapter 3

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-09 · 1B-AP-15

Common Core State Standards for Mathematics

Number & Operations in Base Ten · Grade 4

Read, compare and round big numbers.

Code 4.NBT.A.2Read 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 compare numbers to make decisions in code.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 1B
✦ CSTA 1B-AP-10 · CSTA 1B-AP-09 · CSTA 1B-AP-15 · ISTE 1.5.a · Standards
🎯 I cancompare numbers to make decisions in code
🧩 New blocks3 blocks
📝 New words9 words
⏱ Lesson time~40 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students confuse the assignment = (set variable) with the comparison = (operator_equals). Stress that the green diamond checks, the orange block sets.
  • Students place comparison blocks outside the if-diamond slot — the block must snap INTO the diamond shape of the if block.
  • Students expect the cat to say something every frame; remind them the say block only fires when the condition is TRUE.

🎯 Differentiation

🐢 Struggling: Give a printed number line 0–10. Have students circle numbers above 5, then map those to 'true' before touching Scratch.

🚀 Advanced: Chain two comparisons: if score > 5 AND score < 10 — preview of boolean logic (next chapter).

💡 During the lesson

  • Warm-UpHold up two number cards (e.g. 7 and 4). Ask the class: "Which is greater?" Then ask: "How does a computer know?" Introduce the idea that code must use a comparison block — it cannot just "see" numbers the way we do.
    Trace the sequence aloud: "Score starts at 0. Every step, score gets bigger. When score passes 5 — the condition is TRUE — and the cat reacts." Ask students to predict at which frame the cat says something.
  • Try ItPoint out the diamond shape of all three green operator blocks and the if slot. Say: "They are the same shape — that is how you know they fit together." Read each symbol aloud: > greater, < less, = equal.
    The second experiment introduces operator_lt; the third introduces operator_equals. Ask: "With score = 10, which if fires?" (both > and = — 10 > 5 is TRUE too, so the cat says "High score!" then "Exact!"). The = block is TRUE only when the two numbers are exactly equal — not bigger, not smaller. Each check compares the score with a threshold number; the checks can overlap.
  • PlanWalk through the flowchart together. Emphasize the decision diamond — "Is score > 5?" has two exits: TRUE and FALSE. This is the core of algorithmic thinking at L3.
  • BuildThe most common error: students put the > block NEXT TO the if block instead of INSIDE the diamond slot. Show it on the projector — drag slowly and hover until the diamond slot glows white before releasing.