Search Header Logo
Lesson 12: Combining Variables and Conditions

Lesson 12: Combining Variables and Conditions

Assessment

Presentation

Computers

6th - 8th Grade

Practice Problem

Medium

Created by

Tory Williams

Used 355+ times

FREE Resource

10 Slides • 6 Questions

1

Open Ended

Question image

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

media

6

media
media

​ Conditionals and Variables

7

Open Ended

What happened in this program? (What has to happen for things to kick off?)

https://scratch.mit.edu/projects/822594299

8

What is a "conditional"?

A piece of code that needs to check if something is true or false before it runs.

media

9

10

media

11

12

Multiple Choice

In Basketball, what are good variables?

1

Score

2

If the team wins

3

If the team loses

4

Whether the team listens to the coach

13

Multiple Choice

A variable is used to...

1

tell if an expression is true or false

2

repeat the same instructions over and over again

3

store information to be referenced and used by programs

4

store information so that it is never used in the program

14

Multiple Choice

Question image

Statements that can only run under certain conditions or situations such as: if the seat is taken, then move to the next available seat.

1

conditionals (if/then statements)

2

variable

3

abstractions

4

binary

15

Multiple Choice

The information that’s stored inside a variable, such as a number or a name, is called what?

1

Variable

2

Value

3

Object

4

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

Question image

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