# CHAPTER 12 — Logical Expressions

The `IF`

statements and the `DO WHILE`

statements of the previous
chapters could only ask simple questions,
like `COUNT < 10`

or `HUE >= 16`

.
Often simple questions like these are not enough.
This chapters discusses ways to ask more complicated questions.

#### Chapter Topics:

*Relational Expressions* (review)
*Logical Expressions*
`AND`

*Operator in QBasic*
*Checking that a number is in range*
*Syntax of Logical Expressions*
*OR Operator in QBasic*
*Comparison between* `AND`

*and* `OR`

### QUESTION 1:

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 1 cup of sugar.
You look in your supplies and find 3 cups of flour and 2 cups
of sugar.

Can you bake cookies with the supplies that you have?