Class Lab
java.lang.Object
Lab
public class Lab
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description Lab(int cap, java.lang.String day)
Labs constructor -
Method Summary
Modifier and Type Method Description void
calculateAvg()
this method is used to calculate the students averagevoid
enrollment(Student std)
checks if the student can enroll to the class according to the current size and the capacityint
getAvg()
getter for average which returns the averageint
getCapacity()
a getter for capacityjava.lang.String
getDay()
a normal getter for day which gets the dayStudent[]
getStudents()
getter for students which returns the array of studentsvoid
print()
prints the students and also the average which is calculatedvoid
setCapacity(int capacity)
a setter for capacityvoid
setDay(java.lang.String day)
a setter for dayvoid
setStudents(Student[] students)
setter for students which sets te new list of students
-
Constructor Details
-
Lab
public Lab(int cap, java.lang.String day)Labs constructor- Parameters:
cap
- is the lab capacityday
- is the date
-
-
Method Details
-
enrollment
checks if the student can enroll to the class according to the current size and the capacity -
print
public void print()prints the students and also the average which is calculated -
getStudents
getter for students which returns the array of students- Returns:
- the students list as an array
-
setStudents
setter for students which sets te new list of students- Parameters:
students
- is the new students list
-
getAvg
public int getAvg()getter for average which returns the average- Returns:
- avg average
-
calculateAvg
public void calculateAvg()this method is used to calculate the students average -
getDay
public java.lang.String getDay()a normal getter for day which gets the day- Returns:
- day
-
setDay
public void setDay(java.lang.String day)a setter for day- Parameters:
day
- will set the day
-
getCapacity
public int getCapacity()a getter for capacity- Returns:
- the class capacity
-
setCapacity
public void setCapacity(int capacity)a setter for capacity- Parameters:
capacity
- will be the new lab capacity
-