## Let's see some object oriented - like ideas in Julia
struct Person
name::String
year::Int
end
struct Assignment
name::String
duedate::String
end
struct ClassObject
people::Vector{Person}
room::String
grades::Vector{Int}
assignments::Vector{Assignment}
end
function add_person!(class::ClassObject, person::Person)
push!(class.people, person)
push!(class.grades, 0)
end
# In Python, this might have been
# class = ClassObject()
# class.add_person(Person("John", 1990))
# In Julia, we'd do...
#
class = ClassObject([], "Room 101", [], [])
add_person!(class, Person("John", 1990))
begin
add_person!(class, Person("Xing", 1992))
add_person!(class, Person("Albert", 1992))
add_person!(class, Person("Cassandra", 1993))
end
4-element Vector{Int64}: 0 0 0 0
##