Question
Asked by:
nbutler2140
 

$10.00 Algorithm verification

  • From Computer-Science: Algorithms
  • Closed, but you can still post tutorials
  • Due on Jun. 12, 2008
  • Asked on Jun 11, 2008 at 5:49:52PM
Q:
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?"


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


 
Attachments:
it210_appendix_J Algorithm Verification.doc (41K)


   
   
   
   
 
Available Tutorials to this Question
Posted by:
Aks21
Aks21
Rating (351): B-
Questions Asked: 6
Tutorials Posted: 1063, earned $16,637.40
 

$8.25 Complete Solution with detailed answers to all questions

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Jun 11, 2008 at 6:00:17PM
A:
Preview: ... rithm Verification<br><br>Consider the following selection statement where X is an integer test score between 0 and 100. <br><br>input X<br><br>if (0 <= X and X < 49)<br> output "you fail"<br><br>else if (50 <= X and X < 70)<br> output "your grade is" X<br> output "you did OK"<br><br>else if (70 <= X and X < 85)<br>output "your grade is" X<br> output "yo ...

The full tutorial is about 263 words long plus attachments.

Attachments:
Appendix J.doc (44K) (Preview)
Posted by:
sudipta
sudipta
Rating (2462): A
Questions Asked: 0
Tutorials Posted: 15331, earned $72,342.04
 

$10.00 Answered all parts

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Jun 11, 2008 at 6:02:49PM
A:
Preview: ... ed if the input is 51?<br>The printed output will be<br>your grade is 51<br>you did OK<br>how did you do?<br><br>What will be printed if the user enters “Wingding”?<br>The code will not accept the input because X is an integer, and "Wingding" is a string.<br><br>Is this design robust? If so, explain why. If not, explain what you can do to make it robust.<br><br>No, the design is not robust because it does not cover the full range of integer scores between 0 and 100. For instance, it ...

The full tutorial is about 415 words long .
Posted by:
angemariew
angemariew
Rating (12): B-
Questions Asked: 14
Tutorials Posted: 84, earned $609.89
 

$5.00 Appendix J Algorithm Verification

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Jan 19, 2009 at 12:17:20PM
A:
Preview: ... d X < 100)<br>output "your grade is" X<br> output "you did great"<br><br>endif<br>output "how did you do?"<br><br>o What will be printed if the input is 0? You fail<br> how did you do?<br><br>o What will be printed if the input is 100? how did you do?<br><br>o What will be printed if the input is 51? Your grade is 51<br> you did OK<br><br>o What will be printed if the user enters “Wingding”? If ...

The full tutorial is about 395 words long plus attachments.

Attachments:
appendix j.docx (20K) (Preview)
Posted by:
vman12586
vman12586
Rating (21): A+
Questions Asked: 0
Tutorials Posted: 226, earned $1,081.28
 

$8.00 Algorithm Verification

  • This tutorial was purchased 1 time and hasn't been rated yet.
  • Posted on Apr 05, 2009 at 10:37:55PM
A:
Preview: ... you can do to make it robust. --- This is not a robust design. All the values must be integer and if they are not, set up case to handle every other value > 0 and => 100 and string.<br><br>6. How many levels of nesting are there in this design? – “There is not nesting. Nesting is a controlled structure ...

The full tutorial is about 276 words long .
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty