Advertisement
Guest User

ruby

a guest
Aug 11th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class Student < Person
  2. def initialize(firstName, lastName, id, scores)
  3. super(firstName)
  4. super(lastName)
  5. super(id)
  6. @scores = scores
  7. end
  8. def calculate()
  9. fin = scores/2
  10. puts "O" if fin >= 90 && fin <= 100
  11. puts "E" if fin >= 80 && fin < 90
  12. puts "A" if fin >= 70 && fin <= 80
  13. puts "P" if fin >= 55 && fin < 70
  14. puts "D" if fin >= 40 && fin < 55
  15. puts "T" if fin < 40
  16. end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement