Created
August 11, 2016 15:40
-
-
Save anonymous/1c218b32ef74bc7e865c35614620ef0f 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 Student < Person | |
def initialize(firstName, lastName, id, scores) | |
super(firstName, lastName, id,) | |
@scores = scores | |
end | |
def calculate() | |
fin = 0 | |
@scores.each do |x| | |
fin += x | |
end | |
fin /= 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 | |
solution.rb:37:in `+': no implicit conversion of nil into String (TypeError) | |
from solution.rb:37:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment