Lesson 17: Variables in Play Lab

Overview

Students will get further practice with variables in this lesson by creating scenes in Play Lab. Students will work with user input to set the values of their variables, then get space to create their own mini-project with variables.

Purpose

This lesson lets students use variables to display phrases or conversations based on user input. This lesson serves as a wonderful practice exercise for variables in programming, with an extra dose of creativity! At the end of the puzzle sequence, students will be presented with the opportunity to share their projects with family and friends.

Agenda

Warm Up (15 min)

Main Activity (30 min)

Wrap Up (15 min)

View on Code Studio

Objectives

Students will be able to:

  • Use variables to hold words and phrases.
  • Use variables in conjunction with character prompts.

Preparation

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the Teachers

For the Students

Vocabulary

  • Variable - A label for a piece of information used in a program.

Support

Report a Bug

Teaching Guide

Warm Up (15 min)

Introduction

Ask the class to raise their hand and say what their favorite food is. Choose a couple of students to respond. On a display (either a whiteboard or a poster) write:

(name of the student) likes (favorite food)

Example: Kiki likes pasta.

After a couple of students, ask the class if you could use variables to continue this for the rest of the class. Ask them where the variables might go and what they might be called. Once the discussion is done write:

[name] likes [food]

on the same display.

Ask the students what is a variable and what isn't. How do they know? What else could they use variables for in sentences like these? (examples: favorite color, hometown, number of siblings, etc)

Main Activity (30 min)

Teacher Tip

Remind the students to only share their work with their close friends or family. For more information watch or show the class Pause and Think Online - Video.

Course F Online Puzzles - 2018 - Website

Your students have already been introduced to variables, but if you find one struggling with the idea, remind them to ask their peers before coming to the teacher for help. This stimulates discussion and encourages a community of learning.

Wrap Up (15 min)

Journaling

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.

Journal Prompts:

  • What was today’s lesson about?
  • How did you feel during today’s lesson?
  • What are some ways you have used variables so far?
  • What else do you think you can do with variables?

Standards Alignment

View full course alignment

CSTA K-12 Computer Science Standards (2017)

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.

Cross-curricular Opportunities

This list represents opportunities in this lesson to support standards in other content areas.

Common Core English Language Arts Standards

L - Language
  • 5.L.6 - Acquire and use accurately grade-appropriate general academic and domain-specific words and phrases, including those that signal contrast, addition, and other logical relationships (e.g., however, although, nevertheless, similarly, moreover, in addition).
SL - Speaking & Listening
  • 5.SL.1 - Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 5 topics and texts, building on others’ ideas and expressing their own clearly.
  • 5.SL.1.a - Come to discussions prepared, having read or studied required material; explicitly draw on that preparation and other information known about the topic to explore ideas under discussion.
  • 5.SL.4 - Report on a topic or text or present an opinion, sequencing ideas logically and using appropriate facts and relevant, descriptive details to support main ideas or themes; speak clearly at an understandable pace.
  • 5.SL.6 - Adapt speech to a variety of contexts and tasks, using formal English when appropriate to task and situation.

Common Core Math Standards

MP - Math Practices
  • MP.1 - Make sense of problems and persevere in solving them
  • MP.6 - Attend to precision
  • MP.7 - Look for and make use of structure
  • MP.8 - Look for and express regularity in repeated reasoning

Next Generation Science Standards

ETS - Engineering in the Sciences
ETS1 - Engineering Design
  • 3-5-ETS1-1 - Define a simple design problem reflecting a need or a want that includes specified criteria for success and constraints on materials, time, or cost.