Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Catalog {
- private Profesor teacher;
- private Student[] students;
- private int grupa;
- private String serie;
- // TODO: Constructor (each class must have 1 teacher and n students)
- public Catalog(Profesor teacher, Student[] students, int grupa, String serie)
- {
- this.students = students;
- this.teacher = teacher;
- this.grupa = grupa;
- this.serie = serie;
- }
- // TODO: Method which returns the average grade of the class
- public float getClassGrade()
- {
- int i;
- float total = 0;
- for(i = 0; i < this.students.length; i++)
- {
- total += this.students[i].get_averageGrade();
- }
- return (total / this.students.length);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement