/*

  This class represents a student.

  It contains student's class StudentInfo (name & id), class StudentGrades, class StudentAGrade

  and class Calculation.  

  It is used to enter and display a student's name and grades.

 

  Author: Ahmad Mobasseri

 */

 

public class Student

{

// Data

      private StudentInfo studentInfo;

      private StudentGrades studentGrades;

//    private StudentAGrade studentAGrade; //Because made one method in class StudentAGrade, static

      private Calculation calculation; //Can make same changes to this class, as did to class StudentAGrade

     

// Constructor

      public Student()

      {

            studentInfo = new StudentInfo();

            studentGrades = new StudentGrades();

//          studentAGrade = new StudentAGrade();

            calculation = new Calculation();

      }

     

// Accessors     

      public StudentInfo getStudentInfo()

      {     return studentInfo;     }

      public StudentGrades getStudentGrades()

      {     return studentGrades;   }

      public Calculation getCalculation()

      {     return calculation;     }

 

// Enter a student name and one grade.

      public void enterAGrade()

      {                              

            studentInfo.enterName(); 

            StudentAGrade.enterAGrade(studentGrades);

      }    

     

// Enter a student name and grades 

      public void enterGrades()

      {                              

            studentInfo.enterName();

            studentGrades.enterGrades();

      }

     

// Display student grades    

      public void displayGrades()

      {

            System.out.println("Student name |   ID     |        Homeworks             | Tot  " +

                        " |    Projects        | Tot   | Mid   |  Fin  | Grade  | A.G.");              

            studentInfo.displayName();

            calculation.calculGrades(studentGrades);

            studentGrades.displayGrades();

      }

}