revised 10/01/98; 12/09/99; 01/20/00
CHAPTER 14 — Boolean Expressions
if statements of the previous
chapters asked simple questions, like
count < 10.
Often such simple questions are not enough.
This chapter discusses ways to ask more complicated questions.
- Relational Operators (review)
- Logical Operators
- AND Operator
- Checking that a number is in range.
- Syntax of Logical Expressions.
- OR Operator
- Comparison between AND and OR.
- NOT Operator.
You have decided to bake some cookies
(much cheaper than getting them at the Mall.)
An interesting cookie recipe calls for 4 cups of flour
and 2 cups of sugar.
You look in your supplies and find 3 cups of flour and 2 cups
Can you bake cookies with the supplies that you have?