Write a function that accepts an input that is a single inte

Write a function that accepts an input that is a single integer score and outputs the corresponding letter grade according to the following grading scale: Score values ranging from 90 to 100 receive an A. Score values ranging from 80 to 89 receive a B. Score values ranging from 70 to 79 receive a C. Score values ranging from 60 to 69 receive a D. Score values ranging from 0 to 59 receive an F. #FUNC, #CHAR

Solution

function letter_grade = student_solution(score)
letter_grade = \'Q\'
if(score >= 90 && score <=100)
letter_grade = \'A\'
elseif (score >= 80 && score <90)
letter_grade = \'B\'
elseif (score >= 70 && score <80)
letter_grade = \'C\'
elseif (score >= 60 && score <70)
letter_grade = \'D\'
else
letter_grade = \'F\'
end

 Write a function that accepts an input that is a single integer score and outputs the corresponding letter grade according to the following grading scale: Scor

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site