CheckPoint: Algorithm Verification
• Answer the following questions about the information in Appendix J:
o What will be printed if the input is 0?
“You fail”
o What will be printed if the input is 100?
“Your grade is 100” and “You did great”
o What will be printed if the input is 51?
“Your grade is 51” and “You did well”
o What will be printed if the user enters “Wingding”?
“How did you do?” – because Wingding is not a value between 0 and 100.
o Is this design robust? If so, explain why. If not, explain what you can do to make it robust.
This design is pretty good, but could use a little bit more backbone. It doesn’t specify what the output will be if a non-numeric value is inputted – there should be an error output in the design. I also think that it should have an output value that would give the test score in a percentage form.
o How many levels of nesting are there in this design?
There are three nested loops in this design.
o Provide a set of values that will test the normal operation of this program segment.
Defend your choices.
Test Values
Input (X) Output
15 You fail
48 You fail
86 Your grade is 86 – You did great
69 Your grade is 69 – You did OK
o Provide a set of test values that will cause each of the branches to be executed.
Test Values
Input (X) Output
30 You fail
60 Your grade is 60 – You did OK
80 Your grade is 80 – You did well
90 Your grade is 90 – You did great
500 How did you do?
o Provide a set of test values that test the abnormal operation of this program segment.
Test Values
Input (X) Output
Hello How did you do?
120 How did you do?
Guess How did you do?
Anything other than a numeric value between 0 and 100 will return the same output. [continues]
• Answer the following questions about the information in Appendix J:
o What will be printed if the input is 0?
“You fail”
o What will be printed if the input is 100?
“Your grade is 100” and “You did great”
o What will be printed if the input is 51?
“Your grade is 51” and “You did well”
o What will be printed if the user enters “Wingding”?
“How did you do?” – because Wingding is not a value between 0 and 100.
o Is this design robust? If so, explain why. If not, explain what you can do to make it robust.
This design is pretty good, but could use a little bit more backbone. It doesn’t specify what the output will be if a non-numeric value is inputted – there should be an error output in the design. I also think that it should have an output value that would give the test score in a percentage form.
o How many levels of nesting are there in this design?
There are three nested loops in this design.
o Provide a set of values that will test the normal operation of this program segment.
Defend your choices.
Test Values
Input (X) Output
15 You fail
48 You fail
86 Your grade is 86 – You did great
69 Your grade is 69 – You did OK
o Provide a set of test values that will cause each of the branches to be executed.
Test Values
Input (X) Output
30 You fail
60 Your grade is 60 – You did OK
80 Your grade is 80 – You did well
90 Your grade is 90 – You did great
500 How did you do?
o Provide a set of test values that test the abnormal operation of this program segment.
Test Values
Input (X) Output
Hello How did you do?
120 How did you do?
Guess How did you do?
Anything other than a numeric value between 0 and 100 will return the same output. [continues]
Cite This Essay
- APA
-
(2010, 08). It 210 - Algorithm Verification Checkpoint. StudyMode.com. Retrieved 08, 2010, from http://www.studymode.com/essays/It-210-Algorithm-Verification-Checkpoint-391339.html
- MLA
-
"It 210 - Algorithm Verification Checkpoint" StudyMode.com. 08 2010. 08 2010 <http://www.studymode.com/essays/It-210-Algorithm-Verification-Checkpoint-391339.html>.
- CHICAGO
-
"It 210 - Algorithm Verification Checkpoint." StudyMode.com. 08, 2010. Accessed 08, 2010. http://www.studymode.com/essays/It-210-Algorithm-Verification-Checkpoint-391339.html.