Computing · Stage 4

Variables: Boxes that Change

Thinking It Through · computational thinking · use a variable to store a value that changes

✦ Computing📘 Stage 4 · S4⏱ ~10 min🧒 Ages 8–9★ Free to start
use a variable to store a value that changes
Kavi the owl for Computing
📖

Kavi Keeps the Score

Kavi was playing a berry-catching game and kept losing count. "How many berries have I caught?" Kavi hooted. So Kavi made a box with a name on it: score. Kavi started the box at 0. Every time a berry dropped in the basket, Kavi added 1 to the box — 1, then 2, then 3. The number inside kept changing, but the box kept the same name. "A box with a name that holds a value I can change," said Kavi, "is called a variable. Now I never lose count!"

🎓

What your child will learn

1A box with a nameA variable is like a labelled box in a program. It has a name so we can find it, and it holds a value — a number or word — that we can change any time. Tap each part to hear its job.
2A fixed number, or a box that changes?Some numbers never change — the number 7 is always 7. But in a game your score goes up and down. A variable is perfect for a value that keeps changing, because you can put a new value in the same box whenever you need to.
3Using a score variableA variable changes while a program runs. Press ▶ Run and watch the value inside the score box change each time Kavi wins a point.
🔍

A peek inside

A variable score starts at 0. The program says: add 1, then add 1, then add 1. What value does score hold now?
start at 0, then do each change in order: 0 → 1 → 2 → 3

Try this at home: A named box in a program that stores a value we can change is called a ____.

Ready to play and learn?

Start the free interactive lesson, or print the handout for screen-free play.

Part of Computing · Stage 4 · S4 on KAVI Academy — a secular, whole-child learning platform for ages 5–12.