Algorithm Verification wk 6 check point

# Algorithm Verification wk 6 check point - Appendix J is...

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

What will be printed if input is 0? You fail. How did you do? What will be printed if input is 100? How did you do? What will be printed if input is 51? Your grade is 51. You did ok. How did you do? Is this design robust? If so, explain why. If not, explain what you can do to make it robust. No, there isn’t a default condition for scores > = 100, or score < 0. 100 score is valid, so you should add : 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 id (70 <+ x and x <+85) Output “ your grade is “ x Output : you did well” x Else if (85 <+ x and x <100) Output “ your grade is “ x Output “ you did great” Else Output “invalid score” End if - also- if (x>+0 and x <+ 49) output “ you fail” else if (x<70) output “ your grade is” x output “ you did ok” else if (x<100) output “ your grade is” x output “ you did great” else output “ invalid score” end if How many levels of nesting are there in this design?

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

View Full Document
There is not any nesting. Nesting is a control structure inside of a control structure.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Appendix J is just multiple selection statements. Provide a set of values that will test the normal operation of this program segment. Defend your choices.-0 and 49 will test the boundary conditions of the first condition-50 and 69 will test the boundary conditions of the second condition-70 and 84 will test the boundary condition of the third condition-85 and 100 will test the boundary condition of the third condition, which will show that it’s a mistake because 100 is a valid score. Provide a set of test values that will cause each of the branches to be executed.-5 – test the first condition-55 – test the second condition-80– test the third condition-- 90 will test the fourth condition Provide a set of test values that test the abnormal operation of this program segment.-5 – will test invalid input below 0-105 will test the invalid input above 100...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

Algorithm Verification wk 6 check point - Appendix J is...

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

View Full Document
Ask a homework question - tutors are online