Level 5

Powerful Numbers

Level 5 · Chapter 5

What this lesson follows

CSTA K–12 Computer Science Standards (2017)

Algorithms & Programming · Grades 6–8

Combine loops and conditions, even nested ones.

Code 2-AP-12Read the official text

Also practised: 2-AP-17

Common Core State Standards for Mathematics

The Number System · Grade 6

Use negative numbers on the number line.

Code 6.NS.C.7Read 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 apply sqrt, abs, floor, and ceiling to solve real calculation problems.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-AP-12 · CSTA 2-AP-17 · ISTE 1.5.c · Standards
🎯 I canapply sqrt, abs, floor, and ceiling to solve real calculation problems
🧩 New blocks1 block
📝 New words7 words
⏱ Lesson time~40 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students confuse floor with round. floor of 3.9 is 3 (always down), not 4.
  • Students may think sqrt needs a perfect square. sqrt(2) = 1.414… — Scratch handles decimals.
  • Students expect abs of a positive number to change it. abs(5) = 5 — it only affects negatives.

🎯 Differentiation

🐢 Struggling: Start with the calculator build only. Let them type in numbers and see abs/floor/ceiling outputs before introducing distance.

🚀 Advanced: Challenge them to build the circular orbit with sin/cos and adjust orbit speed and radius using variables.

💡 During the lesson

  • Warm-UpAsk students: "If Pico is at x:-100 and a star is at x:60, how far apart are they on the x-axis only?" (160 units.) Then ask: "What if they are also separated on y?" This motivates the Pythagorean formula they will build.
  • Try ItShow the dropdown live. Click it and scroll through all options: abs, floor, ceiling, sqrt, sin, cos, tan, asin, acos, atan, ln, log, e^, 10^. Students enjoy discovering how many operations are inside one block. Focus on abs, floor, ceiling and sqrt here — those four are what §5 Build uses. Sine and cosine come back in the Part C orbit of §5, so point forward rather than explaining them now.
    The first experiment isolates the floor block so students see the rounding-down behavior alone. The second experiment's addition lets them compare floor and ceiling side by side — including the surprise that floor(5) = ceiling(5) = 5. The third experiment removes floor and adds the nested sqrt-of-abs pattern that students will reuse in the Part A calculator build. In Scratch, sqrt of a negative returns NaN; wrapping in abs first prevents this.
  • PlanThe flowchart separates three independent builds. Build the calculator first, then the distance tracker, then the orbit. The tracker and the orbit are the hardest — advanced students may jump ahead to them.
  • BuildStep 5 is the most complex block stack in the chapter. Write it step by step on the board first: dx = (x - starX), dy = (y - starY), dist = sqrt(dx*dx + dy*dy). Then build it left-to-right in Scratch. Students who struggle can use the simpler (distance to [Star ▾]) sensing block and compare outputs — they should match.