Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created August 11, 2016 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c72e89ee90d1a28c752566066a1822a3 to your computer and use it in GitHub Desktop.
Save anonymous/c72e89ee90d1a28c752566066a1822a3 to your computer and use it in GitHub Desktop.
class Student < Person
def initialize(firstName, lastName, id, scores)
super(firstName)
super(lastName)
super(id)
@scores = scores
end
def calculate()
fin = scores/2
puts "O" if fin >= 90 && fin <= 100
puts "E" if fin >= 80 && fin < 90
puts "A" if fin >= 70 && fin <= 80
puts "P" if fin >= 55 && fin < 70
puts "D" if fin >= 40 && fin < 55
puts "T" if fin < 40
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment