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 labjava.lang.String
getDay()
get the day of the labStudent[]
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 labvoid
setDay(java.lang.String d)
set the day of the labvoid
setStudents(Student[] stds)
set the students
-
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 labd
- day of the lab
-
-
Method Details
-
enrollStudent
adds students to the lab.- Parameters:
std
- new student which is going to be added
-
getStudents
get the students of the lab.- Returns:
- students field
-
setStudents
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.
-