I have an assignment to do in matlab:Write a Matlab program tha accepts a numerical value x fro 0 to 100 as input and computes and displays the corresponding letter grade given by the following table:
Letter Grade Marks
A x greater than or equal to 90
B x greater than or equal to 80 and x less than or equal to 89
C x greater than or equal to 70 and x less than or equal to 79
D x greater than or equal to 60 and x less than or equal to 69
F x less 60
Im not that experianced and so cant see what Ive done wrong but keep getting an error saying error==> line 8, which is the val=x line.
Does anyone see what I've done wrong.
This is my code:
%This function accepts a numerical value, x, from 0 to 100
%and computes and displays the corresponding letter grade
%Enter the number as an input argument and a grade from A to F will be
%displayed which corresponds to the number entered.