Student class
Created on Jan. 17, 2017 by Julien Palard
Implement a Student
, School
, and a City
classes like so:
- Student, School, and City have a
name
attribute, given at initialization time. - A Student have an
add_exam(grade)
method, recording a new grade for him, as a float. - A School have an
add_student(student)
method. - A City have an
add_school(school)
method. - Student, School, and City have a
get_mean()
method giving: - For the Student, the average of its results.
- For the School, the average of the students averages.
- For the City the average of the School averages.
- School have a
get_best_student()
method, returning the bestStudent
. - Cities have a
get_best_school()
and aget_best_student()
methods, returning respectively aSchool
and aStudent
..
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|