Home›Lesson Plans›Computer Science›Programming · Grade 4

Variables

Fourth graders meet variables — labeled boxes that hold information a program remembers. A score box holds points; a lives box holds tries left. They match variables to what each one holds, then use a variable in a program.

Grade 4Variables45 minutes1 class periodCSTA / ISTEExplicit teaching4 StandardsCSTA
Start the Lesson
Assign or share this lesson

Copy link works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment.

Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Explain what a variable is.
  • ✓Match a variable to what it holds.
  • ✓Change a value.
  • ✓Use a variable in a program.
Essential Question

How does a program remember information while it runs?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Match It · Interactive

Match the Variable to What It Holds

Project this and match each variable to what it holds — tap the variable, then tap the value.

📦 Match each variable to what it holdsTry it
Variable
What it holds
Now tap what it holds!
The Lesson · Use → Modify → Create (a coding progression with Unplugged practice)

45 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — A Box That Remembers

5 min

How does a game remember your score?

👩‍🏫 Teacher Moves

  • Show a score going up.
  • Ask how it remembers.
  • Set the goal.

🎒 Student Actions

  • Watch.
  • Guess.
  • Get ready.
2

Use — Variables

10 min

Students use the idea.

👩‍🏫 Teacher Moves

  • Send students to Match the Variable.
  • Match each one.
  • Note a variable holds a value.

🎒 Student Actions

  • Match.
  • Say.
  • Note it.
3

Modify — Change the Value

12 min

Students modify.

👩‍🏫 Teacher Moves

  • Set score to 0, then add 1.
  • Lower lives by 1.
  • See what changed.

🎒 Student Actions

  • Set.
  • Lower.
  • See it.
4

Create — Use a Variable

12 min

Students create.

👩‍🏫 Teacher Moves

  • Name a variable (coins).
  • Give it a starting value.
  • Change it in a step.

🎒 Student Actions

  • Name.
  • Set.
  • Change.
5

Reflect — Reflect

6 min

Students close.

👩‍🏫 Teacher Moves

  • Say what a variable is.
  • Name a value one could hold.
  • Complete the exit ticket.

🎒 Student Actions

  • Say it.
  • Name one.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.

CSTA
1B-AP-09

Create programs that use variables to store and modify data.

CSTA
1B-AP-10

Create programs with sequences, events, loops & conditionals.

CSTA
1B-AP-11

Decompose a problem into smaller parts.

ISTE
5 Computational Thinker

Represent and use data.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Label real boxes.
  • Frame: “___ holds ___.”
  • Pair talk first.

Support & Access

IEP / 504
  • Start with score only.
  • Use a counter.
  • One change at a time.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Use two variables together.
  • Change a value in code.
  • Compare number vs text.
Materials

What to gather

  • 📽️Screen / board
  • 📦Labeled boxes
  • 💻Match the Variable
  • 🎮Scratch or paper code
  • 📓Notebooks
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

variablea labeled box that holds a valuevaluewhat is inside the boxscorea number variable in gamestextletters and wordsnumbera value you can count withsetput a value in a variablechangeupdate what a variable holdsrememberkeep a value while the program runs
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
What is a variable?
A labeled box that holds a value.
QUESTION 2
What does a “lives” variable hold?
How many tries are left.
QUESTION 3
What happens to “score” after you win a point?
It goes up by 1.

Reflect: variables.

Have students name a variable a game needs and what it holds. A printable variables worksheet is in the Computer Science library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 CS Variables (Grade 4)Flip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 CS Variables (Grade 4)Quiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ CS Variables (Grade 4)Print
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: change, number, remember, score, set, text, value, variable
  1. what is inside the box
  2. a number variable in games
  3. a labeled box that holds a value
  4. put a value in a variable
  5. letters and words
  6. keep a value while the program runs
  7. update what a variable holds
  8. a value you can count with

Part B · Show what you learned

  1. What is a variable?
  2. What does a “lives” variable hold?
  3. What happens to “score” after you win a point?
Answer key — Part A: 1) value · 2) score · 3) variable · 4) set · 5) text · 6) remember · 7) change · 8) number
Part B: 1) A labeled box that holds a value. 2) How many tries are left. 3) It goes up by 1.