You are on page 1of 5

School of Science and Technology Alamo

Lesson Plan
Technology Application 7 Grade
Date: 10.01.2016 Lesson: Introduction to Variables
Teacher: Samir Ahmadov Content Area: Technology Application
Grade: 7th Software: www.scratch.mit.edu

Description/Abstract of Lesson:

Scholars begin building interactive applications in Scratch. The unit opens with a focus
on mathematics, including an exploration of coordinate planes, ositioning using the x and y
axes, variables, conditional statements, functions, and randomness. Scholars will use these
concepts to create numerous elements of interactive games, such as primary character
movement, timers, points, enemies, barriers, and multiple levels. Scholars will build multiple
interactive games throughout this unit, utilizing the problem solving framework and group
development principles.

Objectives

- SWBAT work with all four basic math operators.


- Students will create, set, and change variables.
- Identify the value of a variable after a set of code has been executed.

Lesson Summary

- Do Now - Math 7 min


- Explore - The Variable Box 8 min
- Create - Making Variables 15 min, Variables Challenges 15 min

Vocabulary

Variable: A variable is a placeholder for some value. The value of a variable can be changed.

Prioritized Blocks of Code

- The block will set the specified variable to the given value

- The block will change the specified variable by a given amount


- This lesson also introduces the operator blocks, which perform specific operations on
multiple values:
Do Now Math (7min)

Say: Good Morning Computer Scientists! Take the next 3 minutes and complete the Do
Now. Make a prediction about what the cat will say when the program runs.

Direction: Check answer after students complete do now in 3 min, outcome here should be
that students are naming that these are operators. Have scholars open scratch and open up a
new project. Show them where the operators blocks are, and then give them 1 minute to run
problem three. Cold call answers.

Student View / Examplar Answer (4 min)

Question1: Simplify the following expression: 10 3

Answer: 3

Question2: Jonathan is about to say the sum of three and six. What will he say?

Answer: 9

Question3: What will occur if the code below is run?

Answer: The sprite will say 6 because the difference between 10 and 4 is 6.

Say: For question three, some people said the cat would say 10 - 4, and others said the
cat would say 6. Lets discuss these two options. Why would the sprite say 10 4 and
why would the cat say 6? Which one did you pick? why? When we use operators in
Scratch, the program will give us the outcome, instead of the problem itself. We will be
using the operator tools today as we begin exploring today's topic, variables.

Explore The Variable Box 8 min.

Direction: The purpose of this next section is for scholars to understand that a variable is a
placeholder for some value. In Algebra, the variable x often stands for a value. Set a box on your
table. The box should have 72 cent inside of the box. Take out another dime and drop it into
the box. Explain that now 10 cents have been added to the box. So this is no longer my 72 cent
box. Now this is an 82 cent box. Drop a nickel in the box. Cold call scholars to explain what kind
of box this is now. Ensure that all scholars can explain why the things they identified were
variables.

Say: Today, this box isn't just a box. This is our money box. Right now, looking inside, I can
see that this box has $0.72 inside of it. So right now, this is our seventy-two cent box. While the
physical box has not changed through the last two minutes, the value of the box has changed
significantly. That's why we are going to call the value of this box our variable. A variable's value
can change throughout time. This is a little different than how we define variables in math, so
don't get confused with that!

Student View / Examplar Answer (4 min)

Question1: What are some other real world examples of variables?

Answer: Answers vary. Can include anything with a changing value, such as the miles on a
cars odometer.

Question2: What are some examples of values that might change in a program?

Answer: Answers vary. Examples could include points in a game, or time left on a timer.

Teacher Tips: A common misconception for variables in Scratch is that they are static values.
Scholars often solve for variables in math and assume that a variable doesnt have a flexible
value. Address this in the questions above.

Create Making Variables 15 min

4 min hole group discussions, 2 min Cold Call, 9 min - Shoulder Partners and group
discussion

Directions: Open up the "Making Variables" step on the platform and walk through the first
six items with scholars using the say section below. Cold call answers, the objective here is that
scholars recognize the difference between set and change blocks in Scratch.

Say: Just like in the real world, we use variables in scratch. Open up the data tab and select
make a variable. We will name this first variable score. You'll notice that the value of the
variable is displayed in the top left corner. There are two things we can do to variables once
they are created. We can either set the value of the variable or change the value of the
variable. Which of these things would we want to do first and why? Let's start by setting the
value of the variable "Score" to 0. You can set the score to have any value, but we are doing to
stick with zero. Once the score is set, we can now start changing it. Add a change block, and
change the variable by 1. Before we run this program, what will the value of score be once this
is complete?

Student View

Step 1: Click the Data tab and then click the Make a Variable button.

Step 2: Name the first variable score.

Step 3: We can either set the variable or change the variable. Which do we want to do first?

Step 4: Make the variables score 0.


Step 5: You should see the variables value in the top left corner of your screen.

Step 6: Now lets add a change block to our code, so it should look like the following script.
Before you run the code, predict what you think the value of score will be?

Answer: The value of score will be 1, because it starts at zero and then increases by 1.

Say: Now, instead of changing the score by a value, lets include math operators! Create a
new variable called Points and set the variable equal to 14. Change the value of the variable
"points" by -2. Pull out an operator block and divide the variable Points by 3 and have the sprite
say the variable. Your script should match the one below.

Direction: Give shoulder partners two minutes to complete this project, and then display
correct answers for scholars to check against. Before you run the script, predict what you think
the sprite will say.

Step three will take scholars through the Making Variables section of this lesson. If
scholars are successful through the first two steps, hold off on having scholars move to step 3. If
they need support, use the stop.

Student View

Step 7: Now, instead of changing the score by a value, lets include math operators! Set the
points to 14. Change the points by -2. Pull out an operator block and divide the variable Points
by 3 and have the sprite say the variable. Your script should match the one below. Before you
run the script, predict what you think the sprite will say?

Answer: Points will start at 14, and then decrease by 2, so now the value will be 12. The
sprite will then say 12 divided by 3, so the sprite will say 4 for 2 seconds.

Challanges 15 min

Have scholars work through the challenges. Use Challenge 3 to gather information on who
is successful and who is struggling. For scholars who are struggling, either work with them
independently or pull them into a small group to review the challenges. Use Challenge 3 as a
check for understanding.
Challenge 1: Predict the code below:

Now build the script in Scratch and run it. Were you correct? Why or why not?

Answer: The variable speed is set to 10. The sprite will then say 10.

Challenge 2: Predict the code below:

Now build the script in Scratch and run it. Were you correct? Why or why not?

Answer: The variable speed is set to 10, and then changed by 10. The sprite then says the
new value of 20.

CFU Challenge 3: Predict the code below:

Now build the script in Scratch and run it. Were you correct? Why or why not?

Answer: The variable speed is set to 13. The sprite is then changed by -5. The sprite then
says the new value of 8.

You might also like