Question: 3.8 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
3.8
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 that is less than zero or greater than 100. Test your function with 89.9999, 90, 45, and 120.
Note: Existing solution on Chegg is not helpful and cannot get it to work. Please provide a detailed explanation on how to run and save function in addition to the test run. Thank you.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
