U4l01 Variables Expore

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Names:

Unit 4 Lesson 1 Activity Guide


Complete this with your partner in class

Step 1​: Explore the apps on ​Level 2-4 in Code Studio​.

Write down two examples where the app seems to be keeping track of a piece of information or
using it to make a decision:

● Example 1: How many times I click

● Example 2: When I buy a upgrade

Step 2​: Operators

Make a copy of the ​digital manipulatives​ and share with your


partner.
● On a sticky note, make one number and one string. The number should be on a yellow
sticky note, and the string on a pink sticky note. Paste a screenshot of your sticky note
below:
● On a sticky note, evaluate the expression on a sticky note.
Put your results on a sticky note. Paste a screenshot of your sticky note below:

● Evaluate each of the following on your sticky notes. Paste the results in the table below.
Be sure to use the appropriate color for the type of sticky note (number is yellow or string
is pink).
9

treehouse

your

3D

Step 3: ​ Variables
● The plastic bags are "variables." Make one variable with any name you like using your
digital manipulative​ and label a plastic bag with that name. Paste a screenshot of the
variable below:
● Evaluate these expressions. Make sure you pay attention to whether it evaluates to a
string or a number. Paste your sticky notes with your answers in the spaces provided:

12

beep
before

Step 4: ​ Variables in programs


● Give the values of the variables at the end of the program by creating bags with the
appropriate names and putting a sticky note in the appropriate bag. Take a screenshot
and paste your results below:

Code Value of Variables


00​ var pizza
01​ pizza ← ​3
02​ var tacos
03​ pizza ← ​“yum”
04​ tacos ← ​“the best”
● Give the values of the variables at the end of the program by creating bags with the
appropriate names and putting a sticky note in the appropriate bag. Take a screenshot
and paste your results below:

Code Value of Variables


00​ var zow
01​ var fly
02​ fly ← ​“to”​ + ​“day”
03​ zow ← ​4​ - ​1
04​ fly ← ​3​ * ​3
05​ zow ← ​4​ + ​“now”
● Give the values of the variables at the end of the program by creating bags with the
appropriate names and putting a sticky note in the appropriate bag. Take a screenshot
and paste your results below:
Code Value of Variables
00​ var fuzz
01​ var clip
02​ fuzz ← 5
03​ clip ← fuzz + 2
04​ fuzz ← clip + 1
05​ clip ← “gr” + fuzz
06​ fuzz ← fuzz + 1
07​ fuzz ← fuzz + 1
08​ fuzz ← fuzz + 1

You might also like