Created
February 10, 2015 00:25
-
-
Save anonymous/5dd1b31f8ab49cd67109 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 Grade | |
attr_accessor :assignment_name | |
attr_accessor :max_points | |
attr_accessor :points_received | |
def initialize(name, points) | |
@assignment_name = name | |
@max_points = points | |
@points_received = nil | |
end | |
def to_s | |
'%-15.15s' % @assignment_name + " : " + '%-2.2s' % @max_points + " " + '%-2.2s' % @points_received | |
end | |
end | |
if __FILE__ == $0 | |
grades = Grade.new("Grade1", 40) | |
grades.points_received = '5' | |
grade_arr = Array.new | |
grade_arr << grades | |
puts grade_arr | |
end |
cromega
commented
Feb 10, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment