Package com.company

Class Lab

java.lang.Object
com.company.Lab

public class Lab
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    Lab​(int cap, java.lang.String d)
    create a new lab with given capacity and day.
  • Method Summary

    Modifier and Type Method Description
    void calculateAvg()
    calculates the average of the lab based on students' grades.
    void enrollStudent​(Student std)
    adds students to the lab.
    int getAvg()
    set the average of the students.
    int getCapacity()
    get the capacity of the lab
    java.lang.String getDay()
    get the day of the lab
    Student[] getStudents()
    get the students of the lab.
    void print()
    prints all the students' details and the average of the class.
    void setCapacity​(int cap)
    set the capacity of the lab
    void setDay​(java.lang.String d)
    set the day of the lab
    void setStudents​(Student[] stds)
    set the students

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Lab

      public Lab​(int cap, java.lang.String d)
      create a new lab with given capacity and day.
      Parameters:
      cap - capacity of the lab
      d - day of the lab
  • Method Details

    • enrollStudent

      public void enrollStudent​(Student std)
      adds students to the lab.
      Parameters:
      std - new student which is going to be added
    • getStudents

      public Student[] getStudents()
      get the students of the lab.
      Returns:
      students field
    • setStudents

      public void setStudents​(Student[] stds)
      set the students
      Parameters:
      stds - students
    • getAvg

      public int getAvg()
      set the average of the students.
      Returns:
      avg field
    • calculateAvg

      public void calculateAvg()
      calculates the average of the lab based on students' grades.
    • getDay

      public java.lang.String getDay()
      get the day of the lab
      Returns:
      day field
    • setDay

      public void setDay​(java.lang.String d)
      set the day of the lab
      Parameters:
      d - day og the lab
    • getCapacity

      public int getCapacity()
      get the capacity of the lab
      Returns:
      capacity field
    • setCapacity

      public void setCapacity​(int cap)
      set the capacity of the lab
      Parameters:
      cap - capacity of the lab
    • print

      public void print()
      prints all the students' details and the average of the class.