Lesson 4: Variables

In this lesson, we’ll explore the concept of a variable, an important way to store information and make your programs more flexible and adaptable. We’ll build on what we have learned about Events by using a variable to pass additional information in when an event occurs. Finally, we’ll challenge you to write your own program using variables to customize how it runs.

* You can also watch this video here.

Lesson structure

  • Overview: What is a Variable?
  • Unplugged Activity: The Rhythm Robot
  • Minecraft Activity 1: Chicken Storm coordinates
  • Minecraft Activity 2: Arrow Counter
  • Minecraft Activity 3: Fall is in the Air
  • Minecraft Activity 4: Wordsmith
  • Project: Variables to remember information
  • Assessment: Rubric
  • Standards: Listed

Lesson plan

  1. Overview: What is a Variable?
  2. Unplugged: The Rhythm Robot
  3. Activity: Chicken Storm
  4. Activity: Arrow Counter
  5. Activity: Fall is in the Air
  6. Activity: Wordsmith
  7. Independent Project

CSTA K-12 Computer Science Standards

Targeted standards for this lesson:

  • CL.L2-03 - Collaborate with peers, experts, and others using collaborative practices such as pair programming, working in project teams, and participating in group active learning activities.
  • CT.L1:6-01 - Understand and use the basic steps in algorithmic problem-solving.
  • CT.L1:6-02 - Develop a simple understanding of an algorithm using computer-free exercises.
  • CPP.L1:6-05 - Construct a program as a set of step-by-step instructions to be acted out.
  • 2-A-5-7 - Create variables that represent different types of data and manipulate their values.