# Algorithm Verification

Algorithm Verification

The following selection statement where X is an integer test score between 0 and 100.

input X

if (0 &lt;= X and X &lt; 49)

output &quot;you fail&quot;

else if (50 &lt;= X and X &lt; 70)

output &quot;your grade is&quot; X

output &quot;you did OK&quot;

else if (70 &lt;= X and X &lt; 85)

output &quot;your grade is&quot; X

output &quot;you did well&quot;

else if (85 &lt;= X and X &lt; 100)

output &quot;your grade is&quot; X

output &quot;you did great&quot;

endif

output &quot;how did you do?&quot;

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.

Habilidades: Programação C

Acerca do Empregador:
( 7 comentários ) Granby, United States

ID do Projeto: #153071