Object Methods
Lesson 31Author : GOUP
Last Updated : September, 2020
Code
class Student
attr_accessor :name, :major, :gpa
def initialize(name, major, gpa)
@name = title
@major = author
@gpa = gpa
end
def has_honors()
if self.gpa >= 3.5
return true
end
return false
end
end