Day 14

Instructional Day: 14

Topic Description: This lesson provides an introduction to the concept of variables.

Objectives:

The students will be able to:

Explain the concept of variables.

Create examples of variables.

Explain the concept of iteration.  Create examples of iteration.

Outline of the Lesson:

Finish Presentations (25 minutes)

Journal Entry (5 minutes)

Make Variable Example (15 minutes)

Enhance Variable Example (10 minutes)

Student Activities:

Finish Presentations.

Complete journal entry.

Participate in a discussion of the Make Variable example.

Enhance the variable example.

Students will do the following:

1. Use Variables to create a game that awards point for eating health food and subtracts points for eating unhealthy foods. Use this link to see an example of the game: Link to program: https://scratch.mit.edu/projects/46233362/

Finish Presentations o Have students fill out Peer Grading sheet.

o To help students vote on the best, you may need to do a quick recap of the stories. You may also want to quickly replay some of the better ones.

o Another option is to have students pick the best of each day and do a run off just replaying the top 3 from each day.

Journal Entry: What does the word variable mean in both mathematical and English terms? o Time the students so they work 3 minutes individually and 2 minutes sharing with their elbow partners.

Make Variable Example o Give two math examples. x + 3 = 5, 2x = 12

§ Ask: What is the name of the variable here? (Answer: x)

§ Although you have x in both equations, its value varies: it is 2 in one equation and 6 in another.

§ The notion is the same in a program—a variable is a name that represents a value that can be changed. In the math example, the name was x.

o Make the variable example with the students (variable example.sb) having the students help you and build their own at the same time. A possible sequence might be

§ Start by explaining that you want to make a game where you earn points for picking healthy foods and lose points for picking unhealthy ones.

What do you think the variable will be? If no answer, ask what name will represent a number that will change? (Answer: Points (or Good Nutrition Points in the example))

§ Add the sprites for the banana, cheesie poofs and text that says “Click on food to eat it”. § Ask: What tab do you think you should click on to make a variable? (Answer: Variables.) § Click “make a variable” calling it Good Nutrition Points.

Clicking the checkbox next to the variable will show or hide it.

§ Ask: If I want to make my points increase by 1 every time I choose the banana, how would I write that script? (See example.)

Explain that this is an example of iteration.

§ As: How about making the points decrease by one when I click on the cheesie poofs? (See example.)

§ Ask: What do you think should happen when the green flag is clicked? (Answer: reset the points

to 0.)

Ask: How do you think we should do that? (In example the script for this is under

Sprite4) o Ask: Does it matter which script the “when green flag clicked” is under? (Answer: No.)

Explain that this is an example of initialization.

Enhance Variable Example o Have Students enhance the variable example by

§ Adding a food that is worth 2 points when clicked on.

§ Adding a food that is –3 points when clicked on.

Resources:

Peer Grading