# Variables in Code > Seventh graders learn about variables — named containers that store and update information in a program — the building blocks that let code remember scores… **Computer Science** | **Grade 7** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g7-cs-variables.html* Seventh graders learn about variables — named containers that store and update information in a program — the building blocks that let code remember scores, names, and any data it needs. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## Everything you need before the bell rings ### Learning Objectives Students will be able to… - Define a **variable**. - Assign and update a **value**. - Explain **data types**. - Use variables in code. How does a game remember your score, or an app remember your name? It stores them in variables. What is a variable, and how does code use one? ## Match the Variable Terms Project this and match each programming term to its meaning — tap a term, then tap what it means. ## 45 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — The Score Keeper How does a game remember your score? It uses a variable! #### 👩‍🏫 Teacher Moves - Show a changing score. - Ask how it’s stored. - Set the goal. #### 🎒 Student Actions - Consider. - Wonder. - Predict. ### Unplugged — Unplug It Students practice. #### 👩‍🏫 Teacher Moves - Use labeled boxes as variables. - Put values in and out. - Feel the idea. #### 🎒 Student Actions - Label boxes. - Swap values. - Feel it. ### Use — Variable Terms Students use. #### 👩‍🏫 Teacher Moves - Send students to Match the Variable Terms. - Match each one. - Note data types. #### 🎒 Student Actions - Match. - Note types. - Explain. ### Modify — Change It Students modify. #### 👩‍🏫 Teacher Moves - Update a variable’s value. - Predict the result. - Explain the change. #### 🎒 Student Actions - Update it. - Predict. - Explain. ### Create — Create Students conclude. #### 👩‍🏫 Teacher Moves - Create a variable for a program. - Assign a value. - Complete the exit ticket. #### 🎒 Student Actions - Create it. - Assign it. - Complete the exit ticket. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and ISTE Standards for Students. Create clearly named variables that store data. Decompose problems using variables. Systematically test and refine programs. Computational Thinker. ## One lesson, every learner ### Multilingual Learners - Term + meaning cards. - Sentence frame: “A ___ stores ___.” - Use labeled boxes. ### Support & Access - Start with variable and value. - Match one pair at a time. - Use real containers. ### Stretch & Extend - Use variables in a program. - Explain scope. - Use several data types. ### What to gather - 📽️Projector / board - 📦Labeled boxes - 💻Match the Variable Terms - 💻Coding tool (optional) - ✏️Pencils - 🎫Exit-ticket slips ### Key terms - **variable**: a named container for a value - **value**: the data stored in a variable - **assign**: to put a value into a variable - **data type**: the kind of value stored - **string**: text data - **integer**: a whole-number value - **boolean**: a true/false value - **update**: to change a stored value ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Create: name your variables. Have students name three variables a simple game would need (like score, lives, playerName) and what each stores. A printable variables sheet is in the Computer Science library. ## Check your understanding **1. What does “variable” mean?** - to put a value into a variable - a named container for a value *(correct)* - a true/false value - the kind of value stored “variable” means: a named container for a value **2. Which word means: “the data stored in a variable”?** - variable - value *(correct)* - integer - data type “value” means: the data stored in a variable **3. What does “assign” mean?** - the data stored in a variable - to put a value into a variable *(correct)* - to change a stored value - the kind of value stored “assign” means: to put a value into a variable **4. Which word means: “the kind of value stored”?** - value - data type *(correct)* - boolean - variable “data type” means: the kind of value stored **5. What does “string” mean?** - a true/false value - a whole-number value - to put a value into a variable - text data *(correct)* “string” means: text data **6. Which word means: “a whole-number value”?** - data type - integer *(correct)* - string - assign “integer” means: a whole-number value ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g7-cs-variables.html All lessons: https://lessonplans.k12academics.com/