previous |
start |
next
Multiple Alternatives
- By using collections of if/else
statements, a program can distinguish between multiple
alternatives.
- Example: The user enters the name of a coin,
and the program returns the value.
- This program has five alternatives to choose
from:
- "penny"
- "nickel"
- "dime"
- "quarter"
- erroneous input
- The order that the alternatives are checked is
unimportant
previous |
start |
next