consider the subsequent selection statement where


Consider the subsequent 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?"

Answer the following:

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

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: consider the subsequent selection statement where
Reference No:- TGS0442261

Now Priced at $15 (50% Discount)

Recommended (99%)

Rated (4.3/5)