previous |
start |
next
Multiple Alternatives
- Order matters:
if (richter >= 0) // always passes
r = "Generally not felt by people";
else if (richter >= 3.5) // not tested
r = "Felt by many people, no destruction";
. . .
- Don't omit else
if (richter >= 8.0)
r = "Most structures fall";
if (richter >= 7.0) // omitted else--ERROR
r = "Many buildings destroyed
previous |
start |
next