
Lesson 12: Combining Variables and Conditions
Presentation
•
Computers
•
6th - 8th Grade
•
Practice Problem
•
Medium
Tory Williams
Used 355+ times
FREE Resource
10 Slides • 6 Questions
1
Open Ended
What happens to a character in a video game if he/she takes too much damage? What else happens in the background?
2
Wednesday, May 10th
Houston Field Trip Details
30 students 3 chaperones
5:00 am Depart School (Breakfast at School)
10:00 am-2:00 pm NASA Space Center (Lunch, Tram Tour, Mission Mars, Starship Gallery)
5:45 pm-6:30 pm Dinner at Golden Corral -Lafayette, Louisiana
8:15 pm Arrive at Baker Middle School
3
Combining Variables and Conditionals
Next Field Trip:
April 21, 2023
SU 3-D Printing Field Trip
Maximum attendance: 60 students
May 9, 2023
LIGO Lab
Maximum attendance: 30 students
In today's lesson:
You will be remixing your Variable projects from Lesson 11.
4
Objectives
Students will be able to...
use conditionals using AND/OR
explain the concept of conditionals.
apply knowledge of conditionals.
enhance a variable program with conditionals.
utilize conditionals and loops appropriately to build an algorithm.
use descriptively named variables to store data.
manipulate data stored in constants and variables.
Essential Question
How can we use conditions and variables to direct the flow of our programs?
5
6
Conditionals and Variables
7
Open Ended
What happened in this program? (What has to happen for things to kick off?)
8
What is a "conditional"?
A piece of code that needs to check if something is true or false before it runs.
9
10
11
12
Multiple Choice
In Basketball, what are good variables?
Score
If the team wins
If the team loses
Whether the team listens to the coach
13
Multiple Choice
A variable is used to...
tell if an expression is true or false
repeat the same instructions over and over again
store information to be referenced and used by programs
store information so that it is never used in the program
14
Multiple Choice
Statements that can only run under certain conditions or situations such as: if the seat is taken, then move to the next available seat.
conditionals (if/then statements)
variable
abstractions
binary
15
Multiple Choice
The information that’s stored inside a variable, such as a number or a name, is called what?
Variable
Value
Object
Conditional
16
Today's Assignment
Today and tomorrow, you will be working on improving your food game. Go to your completed game project (click the my stuff folder in your Scratch account) and save a new copy of it in Scratch so that you don't lose that particular project. You will need to upgrade it by including the following:
add more food sprites (eg. traditional/native foods) by importing images (crawfish, gumbo, etc.....)
play a sound when a food item is clicked (eg. cheer when healthy, boo when unhealthy)
turn the project into a game where the foods move around randomly on the screen and/or disappear when clicked
add a new variable named life points
If the number of nutrition points drops below -4, subtract a fixed number of life points. If the number of points is greater than 9, then add a fixed number of life points
A message about being nutritious if the number of points becomes greater than 9
A message about eating healthier food if the number of points becomes less than -4
What happens to a character in a video game if he/she takes too much damage? What else happens in the background?
Show answer
Auto Play
Slide 1 / 16
OPEN ENDED
Similar Resources on Wayground
10 questions
Charles Darwin
Presentation
•
6th - 8th Grade
12 questions
Bill Nye the Science Guy: Rock and Soil
Presentation
•
6th - 8th Grade
11 questions
Percents: Part of a Whole
Presentation
•
6th - 8th Grade
11 questions
Constructed Response Practice
Presentation
•
6th - 8th Grade
11 questions
Maps for Science
Presentation
•
6th - 8th Grade
11 questions
Revising/Editing Intervention
Presentation
•
6th - 8th Grade
14 questions
Ethical Use of Digital Resources Vocabulary
Presentation
•
6th - 9th Grade
10 questions
Quadrilaterals
Presentation
•
6th - 8th Grade
Popular Resources on Wayground
10 questions
HCS SCI 03 Summer School Review 4
Quiz
•
3rd Grade
11 questions
HSMS - Standard Response Protocol
Quiz
•
6th - 8th Grade
16 questions
1.1-1.2 Quiz Review
Quiz
•
9th - 12th Grade
12 questions
Exponent Expressions
Quiz
•
6th Grade
20 questions
Adding and Subtracting Integers
Quiz
•
6th - 7th Grade
11 questions
Northeast States
Quiz
•
3rd - 4th Grade
10 questions
Characterization
Quiz
•
3rd - 7th Grade
10 questions
Common Denominators
Quiz
•
5th Grade
Discover more resources for Computers
11 questions
HSMS - Standard Response Protocol
Quiz
•
6th - 8th Grade
12 questions
Exponent Expressions
Quiz
•
6th Grade
20 questions
Adding and Subtracting Integers
Quiz
•
6th - 7th Grade
10 questions
Characterization
Quiz
•
3rd - 7th Grade
11 questions
Negative Exponents
Quiz
•
7th - 8th Grade
14 questions
Exponents
Quiz
•
6th Grade