I'm asked to write a program that accepts values from 0 to 100 that will display the corresponding letter grade given the following: A=x>=90 B=x>=80 C=x>=70 D=x>=60 F=<60
For the first part I can ONLY use nested 'if' statements. The second part allows you to you else/elseif which is much easier. So far I have the following, but instead of stopping at the correct statement it continues to display each grade.
prompt='What is the grade from 0 to 100?';x=input(prompt)if x>0 x>=90 disp('A') if x>0 x>=80 disp('B') if x>0 x>=70 disp('C') if x>0 x>=60 disp('D') if x>0 x<60 disp('F') end end end endend
Best Answer