Lesson 10: Using Variables with the Artist
40 minutes
Overview
In this skill-building lesson, students will explore the creation of repetitive designs using variables in the Artist environment. Students will learn how variables make code easier to write and easier to read. After guided puzzles, students will end in a free play level to show what they have learned and create new designs.
Purpose
Variables are essentially placeholders for values that might be unknown at the time that you run your program or for values that can change during the execution of a program. These are vital to creating dynamic code because they allow your program to change and grow based on any number of potential modifications. This stage reinforces the use of variables, using the most basic capabilities of setting and using them.
Standards
AP - Algorithms & Programming
- 1B-AP-09 - Create programs that use variables to store and modify data.
- 1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
Agenda
Objectives
Students will be able to:
- Assign values to existing variables.
- Use variables to change values inside of a loop.
- Utilize variables in place of repetitive values inside of a program.
Preparation
- Play through the puzzles to find any potential problem areas for your class.
- Make sure every student has a reflection journal.
Vocabulary
- Variable - A label for a piece of information used in a program.
Teaching Guide
Warm Up (5 minutes)
Review
It might be helpful to remind students of what they know about variables so far.
- How are variables like a box or container?
- Once information is stored in a variable, how do we use it later in a program?
Main Activity (20 minutes)
Using Variables with Artist
Consider reviewing the Prediction level and video with the full class before moving students on to the Skill Building section.
Wrap Up (15 minutes)
Reflection
Having students write about what they learned, why it’s useful, and how they feel about it can help solidify any knowledge they obtained today and build a review sheet for them to look to in the future.
Prompts:
- What was today’s lesson about?
- How did you feel during today’s lesson?
- Have you tried mixing multiple variables into one program? What might that look like? When would it be helpful?
This work is available under a Creative Commons License (CC BY-NC-SA 4.0).
If you are interested in licensing Code.org materials for commercial purposes contact us.