Boolean Logic: Truth Values
- Due No due date
- Points 0
- Questions 0
- Time Limit None
Instructions
Did you know?
Boolean Logic: Truth ValuesRobots need to know, very clearly, which choice to make under what circumstances. As a consequence, their decisions are always based on the answers to questions which have only two possible answers: yes or no, trueor false.
Statements that can be only true or false are called Boolean statements, and their true-or-false value is called a truth value. Here are some examples of Boolean Statements Robots can answer! |
|
Boolean Statement 1: The sky is blue. |
|
Boolean Statement 2: It snows during summer. |
|
Loops and If-Else conditional statements in ROBOTC are always Boolean statements! They are always either true or false at any given moment. |
|
Robot C Boolean Statement 1: (NOT less than 200). |
|
Robot C Boolean Statement 2: (less than 200). |
Did you know?
Boolean Logic: Comparison Operators
Comparisons (such as the comparison of the Ultrasonic sensor’s value against the number 200) are at the core of the decision-making process. |
ROBOTC Symbol | Meaning | Sample comparison | Result |
---|---|---|---|
"is equal to" | 50 == 50 | ||
50 == 100 | |||
100 == 50 | |||
"is not equal to" | 50 != 50 | ||
50 != 100 | |||
100 != 50 | |||
"is less than" | 50 < 50 | ||
50 < 100 | |||
100 < 50 | |||
"is less than or equal to" | 50 <= 50 | ||
50 <= 100 | |||
100 <= 50 | |||
"is greater than" | 50 > 50 | ||
50 > 100 | |||
100 > 50 | |||
"is greater than or equal to" | 50 >= 50 | ||
50 >= 100 | |||
100 >= 50 |
Only registered, enrolled users can take graded quizzes