CHAPTER 14 — Boolean Expressions

The if statements of the previous chapters asked simple questions such as count < 10. Often simple questions are not enough. This chapter discusses ways to ask more complicated questions.

Chapter Topics:

Questions involving boolean expressions have been prominent on the AP Computer Science Test.

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 2 cups 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?