# 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… **Computer Science** | **Grade 5** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g5-cs-variables.html* 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. **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… - Explain what a **variable** is. - Store a value and **change it**. - Tell numbers, text & **true/false** apart. - Use a variable in a program. What is a variable, and why do programs use them? ## The Variable Explorer Project this and tap each. Have students explore what different variables store. ## 45 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — A Box That Remembers 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. ### Use — Variables 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. ### Modify — Change the Value 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. ### Create — Make Your Own 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. ### Reflect — Reflect 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. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students. Programs that use variables to store and modify data. Create programs with sequences, events, loops & conditionals. Decompose a problem into smaller named parts. Represent data to solve problems. ## One lesson, every learner ### Multilingual Learners - Label real boxes as variables. - Sentence frame: “___ holds ___.” - Pair talk before writing. ### Support & Access - Start with score only. - Use a physical counter. - One change at a time. ### Stretch & Extend - Add two variables that interact (score & lives). - Use a variable in a sentence of code. - Explain number vs text. ### What to gather - 📽️Screen / board - 📦Labeled boxes - 💻The Variable Explorer - 🎮Scratch or paper code - 📓Notebooks - 🎫Exit-ticket slips ### Key terms - **variable**: a named box that stores a value - **value**: what is stored inside a variable - **number**: a numeric value like 0 or 3 - **string**: a text value, written in quotes - **boolean**: a true/false value - **score**: a common number variable in games - **assign**: to put a value into a variable (=) - **update**: to change a variable’s value ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### 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. ## Check your understanding **1. What does “variable” mean?** - to change a variable’s value - what is stored inside a variable - a text value, written in quotes - a named box that stores a value *(correct)* “variable” means: a named box that stores a value **2. Which word means: “what is stored inside a variable”?** - boolean - string - value *(correct)* - score “value” means: what is stored inside a variable **3. What does “number” mean?** - to change a variable’s value - to put a value into a variable (=) - a true/false value - a numeric value like 0 or 3 *(correct)* “number” means: a numeric value like 0 or 3 **4. Which word means: “a text value, written in quotes”?** - update - string *(correct)* - variable - score “string” means: a text value, written in quotes **5. What does “boolean” mean?** - to put a value into a variable (=) - a named box that stores a value - a common number variable in games - a true/false value *(correct)* “boolean” means: a true/false value **6. Which word means: “a common number variable in games”?** - score *(correct)* - boolean - number - assign “score” means: a common number variable in games ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g5-cs-variables.html All lessons: https://lessonplans.k12academics.com/