Consider the following selection statement where X is an integer test score between 0 and 100.

input X

if (0 <= X and X < 49)
output "you fail"

else if (50 <= X and X < 70)
output "your grade is" X
output "you did OK"

else if (70 <= X and X < 85)
output "your grade is" X
output "you did well"

else if (85 <= X and X < 100)
output "your grade is" X
output "you did great"

endif
output "how did you do?"

o What will be printed if the input is 0?
o What will be printed if the input is 100?
o What will be printed if the input is 51?
o What will be printed if the user enters ¿Wingding¿?
o Is this design robust? If so, explain why. If not, explain what you can do to make it robust.
o How many levels of nesting are there in this design?
o Give a set of values that will test the normal operation of this program segment. Defend your choices.
o Give a set of test values that will cause each of the branches to be executed.
o Give a set of test values that test the abnormal operation of this program segment.

Math assistance needed.

To determine what will be printed for each input value in the given selection statement, let's go through each question and analyze the design.

1. What will be printed if the input is 0?
- If the input is 0, the condition `(0 <= X and X < 49)` will be true. Therefore, the output will be "you fail" followed by "how did you do?"

2. What will be printed if the input is 100?
- If the input is 100, the condition `(85 <= X and X < 100)` will be true. Therefore, the output will be "your grade is 100", "you did great", and "how did you do?"

3. What will be printed if the input is 51?
- If the input is 51, the condition `(50 <= X and X < 70)` will be true. Therefore, the output will be "your grade is 51", "you did OK", and "how did you do?"

4. What will be printed if the user enters "Wingding"?
- If the user enters "Wingding" or any non-integer input, the program will encounter an error as it expects an integer. The behavior may vary depending on the programming language or environment used, but it will likely result in an input error or exception.

5. Is this design robust? If so, explain why. If not, explain what you can do to make it robust.
- This design is not completely robust. It assumes that the input will always be an integer between 0 and 100. If the user enters a non-integer value, it will cause an error. Additionally, there is no handling of inputs outside the range of 0 to 100. To make it more robust, we can include additional error handling to ensure that the input is an integer and provide appropriate error messages for out-of-range inputs.

6. How many levels of nesting are there in this design?
- There is only one level of nesting in this design, as there are no nested if-else statements.

7. Give a set of values that will test the normal operation of this program segment. Defend your choices.
- To test the normal operation of this program segment, we can choose values that fall within each condition range:
- Input of 30 will fall within `(0 <= X and X < 49)`, testing the "you fail" output.
- Input of 60 will fall within `(50 <= X and X < 70)`, testing the "your grade is X" and "you did OK" output.
- Input of 80 will fall within `(70 <= X and X < 85)`, testing the "your grade is X" and "you did well" output.
- Input of 95 will fall within `(85 <= X and X < 100)`, testing the "your grade is X" and "you did great" output.

8. Give a set of test values that will cause each of the branches to be executed.
- To test each branch of the selection statement, we can choose values on the boundaries:
- Input of 0 will execute the first branch ("you fail").
- Input of 49 will execute the first branch ("you fail").
- Input of 50 will execute the second branch ("your grade is X" and "you did OK").
- Input of 69 will execute the second branch ("your grade is X" and "you did OK").
- Input of 70 will execute the third branch ("your grade is X" and "you did well").
- Input of 84 will execute the third branch ("your grade is X" and "you did well").
- Input of 85 will execute the fourth branch ("your grade is X" and "you did great").
- Input of 99 will execute the fourth branch ("your grade is X" and "you did great").

9. Give a set of test values that test the abnormal operation of this program segment.
- To test the abnormal operation, we can choose values outside the expected range or non-integer inputs:
- Input of -5 or 101 will test inputs outside the range of 0 to 100.
- Input of "Wingding" or any non-integer input will test the handling of non-integer inputs.