Develop an M-file function that is passed a numeric grade from 0 to 100 and returns a letter grade according to the scheme:
Letter | Criteria |
A | 90 ≤ numeric grade ≤ 100 |
B | 80 ≤ numeric grade<90 |
C | 70 ≤ numeric grade<80 |
D | 60 ≤ numeric grade<70 |
F | numeric grade<60 |
The first line of the function should be
function grade = lettergrade(score)
Design the function so that it displays an error message and terminates in the event that the user enters a value of score
that is less than zero or greater than 100. Test your function with 89.9999, 90, 45 and 120.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.