U4Ch1L5_Conditionals Explore Gradesheet

Purpose: Students learn the basics of conditionals.
Vocabulary: Boolean, Comparison Operators, Logical Operators


Boolean Values: Always Evaluate the Expression on each side of the Comparison Operator before Evaluating the Expression for the Boolean Value!


Boolean Expressions with a Comparison Operators  
(Circle True or False)

6-3

< 

5

True    or    False

12/6

>

3

True    or    False

(7+5)*3

<=

10

True    or    False

9+5

= =

14

True    or    False

Answer

Boolean Values and Variables: Any of the values in an expression can be a variable.
Apply the variable shown in the chart below to the flowchart and determine if the answer is True or False.

Boolean Expressions Variables   (Circle True or False)

Mom says 7

var time

time < 8

True    or    False

Dad says 9

var time

time < 8

True    or    False

Friends say 11

var time

time <  8

True    or    False

Answer

Boolean Values and Multiple Variables
Now apply the two variable shown in the chart below to the flowchart and determine if the answer is True or False.

Boolean Expressions with Multiple Variables   (Circle True or False)

I win the game if:     my Score * my Lives   is greater than 10.

var score, var lives

score = 3, lives = 3

score * lives > 10

True    or    False

var score, var lives

score = 1, lives = 10

score * lives > 10

True    or    False

var score, var lives

score = -5, lives = 2

score * lives > 10

True    or    False

Answer



Challenge: Based on the flowchart shown above, create a multiple step flowchart for the following scenario:
“You can adopt a dog at the SPCA if two conditions are met: 1. “Age” 14 and over, and 2. “Money” is $50.
After you draw the flowchart, then superimpose the following values onto your flow chart and with arrows, show the path that was followed based upon whether or not the conditions were met.
Create a flowchart for a scenario that requires several steps.

1. “Age” 14 and over, and 2. “Money” is $50.

var age, var money

age = 17,  money = $39

True    or    False

Draw Custom Flowchart To Match Scenario

When finished, compare your flowchart to the other student’s flowcharts – answer on class site.
Answer



Truth Tables – Used in evaluating Boolean Expressions.
Read the rules for ‘&&’ ‘||’ and then attempt to answer the scenarios.
Answers on class site.

&&     AND

True

&&

True

True    or    False

True

&&

False

True    or    False

False

&&

True

True    or    False

False

&&

False

True    or    False

||    OR

True

||

True

True    or    False

True

||

False

True    or    False

False

||

True

True    or    False

False

||

False

True    or    False

Answer_AND Answer _OR


Video Programming with Boolean.