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

Coding Variables

Fifth graders meet variables — named boxes that store information a program can use and change. A score goes up, lives go down, a name holds text. They explore real game variables, then use and change their own.

Grade 5Variables45 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.
  • ✓Store a value and change it.
  • ✓Tell numbers, text & true/false apart.
  • ✓Use a variable in a program.
Essential Question

What is a variable, and why do programs use them?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Explore · Interactive

The Variable Explorer

Project this and tap each. Have students explore what different variables store.

📦 Explore variables — tap eachTry it

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

What could a program need to remember while it runs?

👩‍🏫 Teacher Moves

  • Show a game score going up.
  • Ask “how does it remember the number?”
  • Set the goal.

🎒 Student Actions

  • Watch.
  • Guess.
  • Get ready.
2

Use — Variables

10 min

Students use variables.

👩‍🏫 Teacher Moves

  • Send students to the Variable Explorer.
  • Tap each variable.
  • Note number, text & true/false.

🎒 Student Actions

  • Tap each.
  • Say.
  • Note it.
3

Modify — Change the Value

12 min

Students modify.

👩‍🏫 Teacher Moves

  • Set score = 0, then score = score + 1.
  • Change lives from 3 to 2.
  • Spot what changed.

🎒 Student Actions

  • Set.
  • Change.
  • Spot.
4

Create — Make Your Own

12 min

Students create.

👩‍🏫 Teacher Moves

  • Name a new variable (e.g. 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 it 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

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 named parts.

ISTE
5 Computational Thinker

Represent data to solve problems.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Label real boxes as variables.
  • Sentence frame: “___ holds ___.”
  • Pair talk before writing.

Support & Access

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

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Add two variables that interact (score & lives).
  • Use a variable in a sentence of code.
  • Explain number vs text.
Materials

What to gather

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

Key terms — hover for a quick definition

variablea named box that stores a valuevaluewhat is stored inside a variablenumbera numeric value like 0 or 3stringa text value, written in quotesbooleana true/false valuescorea common number variable in gamesassignto put a value into a variable (=)updateto change a variable’s value
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 named box that stores a value you can use and change.
QUESTION 2
What kind of value is “Maya”?
Text (a string).
QUESTION 3
If lives = 3 and you lose one, what is lives now?
2 (lives = lives − 1).

Reflect: variables.

Have students name one variable a favorite game might use and what it stores. 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 5)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 5)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 5)Print
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: assign, boolean, number, score, string, update, value, variable
  1. to put a value into a variable (=)
  2. what is stored inside a variable
  3. a numeric value like 0 or 3
  4. a true/false value
  5. a common number variable in games
  6. a named box that stores a value
  7. a text value, written in quotes
  8. to change a variable’s value

Part B · Show what you learned

  1. What is a variable?
  2. What kind of value is “Maya”?
  3. If lives = 3 and you lose one, what is lives now?
Answer key — Part A: 1) assign · 2) value · 3) number · 4) boolean · 5) score · 6) variable · 7) string · 8) update
Part B: 1) A named box that stores a value you can use and change. 2) Text (a string). 3) 2 (lives = lives − 1).