% Matlab script to assign a grade
%
% Name = Paul Chew
% NetID = lpc2

score = input('What is the score? ');
if score > 100
    error('Score too large')
elseif score >= 92
    grade = 'A';
elseif score >= 88
    grade = 'A or B';
elseif score >= 80
    grade = 'B';
elseif score >= 76
    grade = 'B or C';
elseif score >= 65
    grade = 'C';
elseif score >= 55
    grade = 'D';
elseif score >= 0
    grade = 'F';
else
    error('Input error: negative score')
end % if

fprintf('The grade is %s\n', grade)
