it210_appendix_j

it210_appendix_j - Axia College Material Appendix J...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
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 What will be printed if the input is 100? The section for this type of input does not include the score of 100. If the program code included this score, the code would say: else if(85 <= X and X <= 100). Therefore, the program will display “invalid input” What will be printed if the input is 51? Your grade is 51; You did OK What will be printed if the user enters “Wingding?” I believe the program will crash instantly because the coding is setup to have an integer input, so inputting
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

it210_appendix_j - Axia College Material Appendix J...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online