Skip to content

Latest commit

 

History

History
 
 

2-variables

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Lesson 2 - Variables

image

Before Class


###Teacher Preparation

  • A further understanding of Scratch. Teacher should be familiar with sensing, control, operator and data blocks.

Daily Objective

  • Students will be able to create and implement a variable in a Scratch program.

Key Points

  • A variable, like the variables you use in math class, is a placeholder for a changing value.
  • Variables are like boxes; they store something.
  • Variables have a name and a value.

Assessment

  1. Students will created a program in Scratch that can calculate the area of a rectangle.

Vocabulary

  • Variable

References

During Class

Do Now

  1. Volunteer takes attendance. Procedure found here.
  2. Students will be asked to answer the question below on paper:
    Image

Opening

"Can someone tell me how you have used variables in other classes?" Tell the students how using variables in programming is very similar to using variables in math class. Cover the key points of this lesson:

  • A variable, like the variables you use in Math class is a placeholder for a changing value.
  • Variables are like boxes; they store something.
  • Variables have a name and a value.

Introduction to New Material (“I Do”)

Slowly create, while asking questions from student volunteers, a “Hello, Name” program on the board. Students should be watching and answering questions that the teacher is asking during the demonstration.

Image

Guided Practice ("We Do")

“We have just created a program that can say hello to you. However we did not use a variable. Let’s remake this program, but this time using a variable called Image. Just like how we used variables we we wrote out the MadLibs game.

The students should follow along as the following program is created.

Image
Hint: You can create your own variable in the "Data" section of Scratch.

Independent Practice ("You Do")

Using the knowledge you just learned from creating the hello program, create a program that can calculate the area of a rectangle. Step-by-step instructions are listed below but students are encouraged to create this program on their own if they would like the challenge.

  1. The program must first ask the user for the width of the rectangle.
  2. Store that user input in a variable called "width"
  3. Repeat steps 1 & 2 for the rectangle's height.
  4. Create a third variable called "area"
  5. Using the Operators block, set the "area"" variable to the product of Image
  6. Now you can use the Say block to have Scratchy tell the user the area of the rectangle. Image

Closing

"Today we covered the basics of using variables when writing your own program."

Homework

For homework, students will create a program that calculates the area of a circle.

After Class

  • Take a quick look at each Scratch project from today. Students who were not able to create the program should be asked to recreate the project, with teacher’s help, next class.
  • Prepare for next lesson / hand off to next volunteer in rotation.