U4Ch1L5_Conditionals Explore Gradesheet
Purpose: Students learn the basics of conditionals.
Vocabulary: Boolean, Comparison Operators, Logical Operators
Rule: “If” vs. “When” - We want to be careful about how we use these words.
Do It… 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 |
A Simple Model Flowchart for Boolean Values and a Variable:
Scenario:
Do It… |
|||
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 |
Model Flowchart for Multiple Variables
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.