← Back to course
Code Crew G3 / Week 09 / Friday
5/6
Week 09 Β· Boolean Logic

Friday

// True, false, AND/OR

Friday: Mini-Project

Rocket writes a rule on his tablet. "If it is sunny and chores are done, I ride my bike."

"How will you know your rule works?" Raven asks. Rocket shrugs. "I guess I need to test it."

Nova blinks her blue eyes. "Try your rule on different days," she hints. Now it is your turn. Let's build a rule of your own.

Build a Rule

Pick a real-life situation. Write a Boolean rule for it.

Then test it on 3 different days. Was it ever TRUE? Ever FALSE?

My rule: IF __________________________________
AND/OR ______________________________
THEN ________________________________
Day 1: T / F Day 2: T / F Day 3: T / F

Reflection

Rule Check

TEST THE RULES
  • Read the question.
  • Tap your answer.
park = Saturday AND sunny. It is Sunday and sunny. What is park?
treat = Friday OR birthday. It is Tuesday, and it is not a birthday. What is treat?
read = NOT tired. Raven is tired. What is read?
Which kind of rule is TRUE more often?
swim = warm AND pool open. It is warm. The pool is open. What is swim?
It is warm. The pool is closed. What is swim?
Change AND to OR. It is warm. The pool is closed. What is swim now?
StatementTrue or false?
An AND rule is FALSE if any part is FALSE.?
An OR rule is TRUE if any part is TRUE.?
NOT changes TRUE into TRUE.?
Testing a rule on different days is a good check.?
WHY THIS EXERCISETesting rules with different facts is how programmers find mistakes.

Quick Check

Rule: park = (it is Saturday) AND (it is sunny). It is Saturday and sunny. park is ____.
Same rule. It is Saturday, but it is raining. park is ____.
Rule: treat = (it is Friday) OR (it is my birthday). It is Friday. It is not my birthday. treat is ____.
← Thursday