213k views
3 votes
If a multi-way selection structure has 5 conditions how many levels of nesting does it have? Note: one control structure nested inside another counts as one level of nesting.

Select one:
a. 0
b. 1
c. 4
d. 5

User Zukanta
by
7.5k points

1 Answer

4 votes

Having 5 conditions in a multi-way selection structure does not inherently indicate multiple levels of nesting; instead, it could simply be a sequence of if-else-if statements, resulting in only one level of nesting if at least one set of nested if statements is present.

If a multi-way selection structure has 5 conditions, it does not automatically mean it has any levels of nesting. Nesting occurs when one control structure is contained within another, like a nested if statement within another if statement. Just having 5 conditions could imply a sequence of if-else-if statements with no nesting at all. Therefore, the correct answer is b. 1 level of nesting assuming the 5 conditions are structured with at least one set of nested if statements.

User Jay Kominek
by
7.2k points