Created
June 30, 2013 00:05
-
-
Save tarynsauer/5893213 to your computer and use it in GitHub Desktop.
Calculate a letter grade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_grade(average) | |
case average | |
when 90..100 | |
"A" | |
when 80..90 | |
"B" | |
when 70..80 | |
"C" | |
when 60..70 | |
"D" | |
when 0..60 | |
"F" | |
else | |
"Error" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment