Commit 29a8aa3b authored by 9831067's avatar 9831067

Delete Lab.java

parent 5ff13b14
public class Lab {
/**
* Create a new lab with a given name and ID number and etc.
*
* @param fName first name of student
* @param avg of student
* @param day of student
*
*/
private Student[] students;
private int avg;
private String day;
private int capacity;
private int currentSize;
public Lab(int cap, String d) {
students = new Student[capacity];
day = d;
capacity = cap ;
}
public void enrollStudent(Student std) {
if (currentSize < capacity) {
students[currentSize] = std;
currentSize++;
}
else {
System.out.println("Lab is full!!!");
}
}
public void print() {
for(int i= ; i< currentSize ; i++) {
System.out.println("first name is: "+ firstName + " last name is: "+lastName + "id is : "+ id + "grade is: " + grade);
}
}
public Student[] getStudents() {
return students ;
}
public void setStudents(Student[] students) {
this.students = students ;
}
public int getAvg() {
return avg ;
}
public void calculateAvg() {
int sum = 0 ;
for(int i= 0 ; i< currentSize ; i++) {
sum += grade.student[i] ;
}
avg = sum/currentSize ;
}
public String getDay() {
return day ;
}
public void setDay(String day) {
this.day = day ;
}
public int getCapacity() {
return capacity ;
}
public void setCapacity(int capacity) {
this.capacity = capacity ;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment