created 11/07/98; revised 11/24/99, 01/22/00

CHAPTER 43 -- More Ways to Make Decisions

Various combinations of the if-else statement can be used in a program to perform any decision making that is needed. For example, deciding between more than two alternatives can be done with nested if's. Sometimes this is inconvenient. This chapter discusses other statements that make choices.

Chapter Topics:

  • The Conditional Operator
  • The Switch Statement

Any program can be written without using either of these statements. But they are useful enough to know about, and you will need to know them to use programs written by other programmers.

QUESTION 1:

(Math Review:)

  • What is the absolute value of -9?
  • What is the absolute value of +9?

Click Here after you have answered the question