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 |
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 |
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 |
|
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. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Answer_AND | Answer _OR |
Video Programming with Boolean.