Variables are used as placeholders for values such as numbers or words. Variables allow for a lot of freedom in programming. Instead of having to type out a phrase many times or remember an obscure number, computer scientists can use variables to reference them. This lesson helps to explain what variables are and how we can use them in many different ways. The idea of variables isn't an easy concept to grasp, so we recommend allowing plenty of time for discussion at the end of the lesson.
Variables are very helpful in programming. Students will be introduced to this topic using envelopes to represent variables that have been given names. The value of the variable will be written on a card placed inside an envelope. This lesson helps students understand how names can be a placeholder for values in the physical world so that programming with variables will seem less confusing in the virtual world.
Students will be able to:
- identify variables and determine their values.
- define and call variables in the context of real-life activities.
- create situations which require the use of variables.
Note: You will need to create a free account on code.org before you can view this resource.