% grade3.m
%
%  Determine the letter grade for a given test score.
%
%  Since we are checking the values in decreasing order, we 
%  really only have to check whether the score is ABOVE a certain value.
%
score = input ( '  Enter test score: ' );

if ( 100 < score )
  disp ( '  This score is too high!' )
elseif ( 90 <= score )
  grade = 'A'
elseif ( 80 <= score )
  grade = 'B'
elseif ( 70 <= score )
  grade = 'C'
elseif ( 60 <= score )
  grade = 'D'
elseif ( 0 <= score )
  grade = 'F'
else
  disp ( '  This score is too low!' )
end

