I'm trying to calculate what happens if the total score averages out above 100. I'm currently using a case statement to output the different scores. Would be the optimal solution to express the range above 100, allowing us to output 'A+++'.
def get_grade(score_1, score_2, score_3)
total = (score_1 + score_2 + score_3)/3
case total
# What if the score is above 100?
# I want it to express 'A+++'
when 90..100 then 'A'
when 80..89 then 'B'
when 70..79 then 'C'
when 60..69 then 'D'
else 'F'
end
end
p get_grade(91, 97, 93) # => 'A'
p get_grade(52, 57, 51) # => 'D'
p get_grade(105, 106, 107) # => 'A++'