First of all. I’m new to Ruby. I am working on a program in school -
find the highest grade for X amount of students.
I’ve made this code:
def initialize(name, grade)
@name = name
@grade = grade
students = Array.new
st1 = Person.new(“Mathias”, 57)
st2 = Person.new(“Marta”, 32)
st3 = Person.new(“Peter”, 24)
The grades are stored in the students array. But is there a way to
compare these grades?