I have a question about an algorithm. If an entry that is inputted is outside the parameters of an algorithm, does an error message show?
Here is the algorithm. Please be patient as I am quite new to this. This seems easy to me and I have already been graded on this Appendix. 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?"
If the input is 0 then what would the output be? I thought it would be "you fail" and nothing else. Also if the input is 100, this does not seem to be set up properly for the number 100 so I thought the result would be an error message maybe invalid entry. Can someone help me as I am in constant conflict with this instructor over everything.
Thank you,
Lynnajoe
Edited by Essexboy, 02 August 2010 - 01:10 PM.
e-mail removed