Created
May 18, 2022 09:42
-
-
Save denisdefreyne/04d90de6c63c38aa7501d1936af59df6 to your computer and use it in GitHub Desktop.
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
class Score | |
attr_reader :value | |
def initialize(value) | |
@value = value | |
end | |
def grade | |
if @value < 10 | |
"failing" | |
elsif @value < 14 | |
"passing" | |
elsif @value < 16 | |
"distinction" | |
elsif @value < 18 | |
"high distinction" | |
else | |
"highest distinction" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment