Hi every one; I going to make a function called letter_grade that takes a positive integer called score as its input argument and returns a letter grade according to the following scale: A: 91 and above; B: 81-90; C: 71-80; D: 61-70; F: below 61. Remember that to assign a letter to a variable, you need to put it in single quotes, as in: grade = 'A'. when i run the below codes i got grade 'B' for score 95.which in not correct.Kindly guide me how can i correct this code. Thanks in advance…….
function grade=letter_grade(n)if n >= 91 && n>=100 grade='A';elseif n >= 81 && n>=90 grade='B'; elseif n >= 71 && n>=80 grade='C'; elseif n >= 61 && n>=70 grade='D'; elseif n <61 grade='F';endend
Best Answer