Variables
3-5 Computer Science Modules Series
A subconcept of
Algorithms and Programming
Standard 3.AP.V.1: Create programs that use variables to store and modify data.
Overview of the Lesson
If you find a dead link or error, please report it by completing this form.
What Real-World Problem Does the Standard Address?
Here is an image showing the manager of a shoe store arranging her inventory. There are sure to be many pieces of information she would want to collect in her job. Some of those might include the following:
The list could go on and on. As you look at the image and ponder, write a list of other pieces of information the manager might want to collect. Where and how could she keep all this data? How easy would it be for her to get both historical data and current data?
Your Turn
Write a list of at least three other pieces of information the manager might want to collect. | |
What options does she have for storing all this data, and how easily can she retrieve both historical and real-time data? | |
How is the image and list connected to this computer science standard? | |
What Does the Standard Say?
In this section you will examine the standard and think about the learning targets and potential ways of measuring student understanding of the concept by addressing the session question, "What does the standard say?"
Deconstructing the Standard
Examine how a colleague would interpret the parts of the standard for a student or parent. As you read, think about how you would help a parent interpret the standard language, if you would use the same common understandings, and why it would be important to interpret the standard.
Standard: 3.AP.V.1 Create programs that use variables to store and modify data. | |
Standard Language | Common Understanding |
program | This is a set of instructions through which a computer works. When it is run, a program performs the specific task that the programmer has set for it. As humans, we essentially program everything we do by running a set of instructions through our internal computers--our brains. These sets of instructions can take the form of sequences, events, loops, and conditionals. |
variables | Variables are simply placeholders for bits of information. They are symbolic names that are used to keep track of values. Those values can change while a program is running. Variables can take on the values of numbers, text, whole sentences, or logical values. Almost everything in life could be distilled to some kind of variable. A person's age could be a number variable. A child's name could be a text variable. A person's sleep state could be a logical value, taking on a value of true if asleep and false if awake. |
The Embedded Content of the Standard
Let's say you are a basketball statistician. There would be many different stats for all the players and for the whole team that you would be tasked with recording, calculating, and reporting. You would probably have a scorebook to keep them in, so in a way, that scorebook was created by someone like a program is created to keep track of many pieces of information, or data.
One major data point you would be sure to keep is a player's score. We can think of the score for each player as a separate variable. At the beginning of the game, that score is automatically known to be zero. Each time a player scores, the points earned are added. In this way, the old stored value of the player's score is modified by adding the earned points to come up with a new score, which then becomes the new stored value of that player's score for the game. At the end of the game, whatever value is stored as that score becomes the player's final score.
In addition, the player's season score would certainly be an item of interest. By taking the stored value of the scores for each game, you could easily add them together to find the season score, which would be another variable itself.
The Embedded Content of the Standard
In the basketball analogy, you could write a computer program to track the information. You might start by listing out some of the variables in a chart like the one below. The data types could be numbers, text, whole sentences (strings), or logical values (true or false). Of course, there would be many, many more data points.
Variable Name | Data Type | Example |
Rebounds | Number | 12 |
Fouls | Number | 2 |
Player_First_Name | Text | Jamie |
Player_Last_Name | Text | Williams |
Player_Strength | String | Reliable 3-point shooter |
Starter | Logical | true |
Achieving the Standard
Learning Targets (Student Friendly Language) | Assessment Targets (Student Evidence) |
Standard: Standard: 3.AP.V.1 Create programs that use variables to store and modify data. | |
|
|
Your Turn
With respect to the standard, tell about three things you learned? | |
What are a couple other real-world connections you can make to this standard? | |
What Could This Look Like for My Students?
Think about what activities you would want your students to do in your classroom to develop their understanding.
1. Generate 3 lesson activities or ideas that would help students reach mastery of the standard.
2. Use the learning targets from the previous section as a guide of what students need to know.
3. Focus on the standard as an end goal.
Your Turn
1 | |
2 | |
3 | |
Describe in at 3-5 sentences each of the 3 lesson activities or ideas you came up with according to the instructions on the previous slide.
What Resources Could Support Further Implementation?
In this final section, you will use your knowledge of the standard to examine some potential resources. When you look through the resources, it is important to recognize that students need to actively participate in developing their understanding.
Resources About the Content
Variables with LittleBits
What is here: How variables are used in electronic circuit computing devices that are made for kids.
Resource Link: https://www.youtube.com/watch?v=Jx5Shnsuy74
What is a Variable?
What is here: This is a bit more technical, yet still accessible, definition of variables to extend your knowledge.
Resource Link: https://www.youtube.com/watch?v=Txs3MHINsjI&t=1s
Resources About the Content
Variables Lesson
What is here: This is actually an animation programmed in Scratch. It might be a fun way to teach your students about variables. You press the spacebar to step through it.
Resource Link: https://scratch.mit.edu/projects/98831292/
Resources for Lesson Ideas
Unplugged - Envelope Variables
What is here: A lesson to help explain what variables are and how to use them in various ways.
Lesson Link: https://curriculum.code.org/csf-19/coursef/6
Video Link: https://youtu.be/DI7DprN4FtE
Dog Behavior
What is here: A walk through of programming a dog to walk or stand according to the behavior of a variable.
Resource Link: https://www.youtube.com/watch?v=ADPcdk6kK_0
Resources for Lesson Ideas
Good Guy/Bad Guy Game
What is here: This is a slide deck that could walk you and your students through creating a Scratch game using variables.
Resource Link: https://coderdojosligo.files.wordpress.com/2015/11/scratch-primary-lesson-7.pdf
Artist Variables
What is here: A series of puzzles to learn about and practice the use of variables.
Resource Link: https://studio.code.org/s/course4/stage/6/puzzle/1
Resources for Simulations
The Box Variable Activity
What is here: An excellent, hands-on activity to have students simulate what happens to variables and how they work.
Resource Link: https://teachinglondoncomputing.org/resources/inspiring-unplugged-classroom-activities/the-box-variable-activity/
Your Turn
What resources looked most useful to you and why? | |
What resources or information do you still need to seek out and why? | |