Home›Lesson Plans›Computer Science›Computer Science · Grade 8

Variables & Data Types

Eighth graders learn that programs store different kinds of data in variables — integers, strings, booleans, floats, and lists — and why knowing the right data type matters for writing correct code.

Grade 8Programming50 minutes1 class periodUse → Modify → CreateExplicit teaching4 StandardsCSTA
Start the Lesson
Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Explain a variable.
  • ✓Name key data types.
  • ✓Match types to examples.
  • ✓Use the right type.
Essential Question

A program has to know: is this a number, some text, or true/false? Those are data types. What are the main data types, and why do they matter?

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

Match the Data Type

Project this and match each data type to an example — tap a data type, then tap its example.

📦 Match each data type to its exampleTry it
Data Type
Example
Now tap its example!
The Lesson · Use → Modify → Create (a coding progression with Unplugged practice)

50 minutes, five moves

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

1

Hook — Number, Text, or True/False?

5 min

A program must know a value’s type — what are the data types?

👩‍🏫 Teacher Moves

  • Show mixed values.
  • Ask what kind each is.
  • Set the goal.

🎒 Student Actions

  • Look.
  • Wonder.
  • Predict.
2

Unplugged — Unplug It

11 min

Students practice.

👩‍🏫 Teacher Moves

  • Sort values by type.
  • Label each one.
  • Feel the difference.

🎒 Student Actions

  • Sort them.
  • Label them.
  • Feel it.
3

Use — Match the Types

15 min

Students use.

👩‍🏫 Teacher Moves

  • Send students to Match the Data Type.
  • Match each one.
  • Explain them.

🎒 Student Actions

  • Match.
  • Explain.
  • Check.
4

Modify — Modify It

14 min

Students modify.

👩‍🏫 Teacher Moves

  • Store each type in a variable.
  • Change a value.
  • Predict the type.

🎒 Student Actions

  • Store it.
  • Change it.
  • Predict.
5

Create — Create

5 min

Students conclude.

👩‍🏫 Teacher Moves

  • Name a data type and example.
  • Explain why type matters.
  • Complete the exit ticket.

🎒 Student Actions

  • Name it.
  • Explain it.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

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

CSTA
2-AP-11

Create variables that store data types.

CSTA
2-DA-07

Represent data with different types.

CSTA
2-AP-16

Use data types in programs.

ISTE
5

Computational Thinker.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Type + example cards.
  • Sentence frame: “A ___ holds ___.”
  • Use labeled values.

Support & Access

IEP / 504
  • Start with integer and string.
  • Match one pair at a time.
  • Use examples.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Add more types.
  • Explain type errors.
  • Convert between types.
Materials

What to gather

  • 📽️Projector / board
  • 📦Value cards
  • 💻Match the Data Type
  • 💻Coding tool
  • ✏️Pens
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

variablea named container for datadata typethe kind of data a value isintegera whole numberstringtext databooleana true/false valuefloata decimal numberlistan ordered collectionvaluethe data stored
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 data type is the value 42?
An integer (a whole number).
QUESTION 2
What data type is “hello”?
A string (text).
QUESTION 3
What data type is true or false?
A boolean.

Create: name the type.

Have students write one example of each of three data types. A printable data-types sheet 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.

🃏 Variables & Data TypesFlip
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.

📝 Variables & Data TypesQuiz
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.

🖨️ Variables & Data TypesPrint
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: boolean, data type, float, integer, list, string, value, variable
  1. a whole number
  2. text data
  3. the data stored
  4. a named container for data
  5. the kind of data a value is
  6. a decimal number
  7. a true/false value
  8. an ordered collection

Part B · Show what you learned

  1. What data type is the value 42?
  2. What data type is “hello”?
  3. What data type is true or false?
Answer key — Part A: 1) integer · 2) string · 3) value · 4) variable · 5) data type · 6) float · 7) boolean · 8) list
Part B: 1) An integer (a whole number). 2) A string (text). 3) A boolean.