Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public class Catalog {
  2. private Profesor teacher;
  3. private Student[] students;
  4. private int grupa;
  5. private String serie;
  6.  
  7. // TODO: Constructor (each class must have 1 teacher and n students)
  8. public Catalog(Profesor teacher, Student[] students, int grupa, String serie)
  9. {
  10. this.students = students;
  11. this.teacher = teacher;
  12. this.grupa = grupa;
  13. this.serie = serie;
  14. }
  15. // TODO: Method which returns the average grade of the class
  16. public float getClassGrade()
  17. {
  18. int i;
  19. float total = 0;
  20. for(i = 0; i < this.students.length; i++)
  21. {
  22. total += this.students[i].get_averageGrade();
  23.  
  24. }
  25. return (total / this.students.length);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement