Question: Develop an M-file function that is passed a numeric grade from 0 to 100 and returns a letter grade according to the scheme: The first

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 ABCDF Criteria 90 numeric grade 100 80 numeric grade < 90

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.

Letter ABCDF Criteria 90 numeric grade 100 80 numeric grade < 90 70 numeric grade < 80 60 < numeric grade < 70 numeric grade

Step by Step Solution

3.35 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

ANSWER function grade lettergradescore Check if score is out of ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Applied Numerical Methods Questions!