|
Can a single if-else statement choose one of three options? A good answer might be:No---an if-else statement makes a binary decision, a choice between two options. | |
Nested If for a Three-way ChoiceTo make a three-way choice, a nested if is used. This is where an if-else statement is part of a the true-branch (or false-branch) of another if-else statement. So the nested if will execute only when the outer if has already made a choice between two branches. Here is a program fragment that does that to make a choice of one of the three Strings.
Complete the
| |
QUESTION 8:Click Here after you have answered the question |