Boolean expressions are statements that evaluate to either true or false. They are commonly used in programming to make decisions and control the flow of a program.
Think of a traffic light at an intersection. The traffic light can be in two states - green (true) or red (false). Based on the state of the traffic light, drivers make decisions whether to go or stop.
If statement: A programming construct that allows you to execute a block of code if a certain condition is true.
Logical operators: Symbols such as AND (&&), OR (||), and NOT (!) used to combine multiple boolean expressions and create more complex conditions.
Comparison operators: Symbols such as ==, !=, <, >, <=, >= used to compare values and produce boolean results.
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.