{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CheckPoint Algorithm Verification

# CheckPoint Algorithm Verification - Axia College Material...

This preview shows pages 1–3. Sign up to view the full content.

Axia College Material Appendix J Algorithm Verification 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?" What will be printed if the input is 0? You fail. How did you do? What will be printed if the input is 100? How did you do? What will be printed if the input is 51? Your grade is 51. You did OK. How did you do? IT 210

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
What will be printed if the user enters “Wingding”? The program is expecting an integer value; because a string value is entered the program would crash. Is this design robust? If so, explain why. If not, explain what you can do to make it robust. The design is not robust because there are no default conditions for scores including or above 100 or scores below 0. The integer 49 is not covered; condition 1 covers integers
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}