Need help writing the method: getWaitlistedIDs() – returns an array of type int[], namely the ids of students in the waitlist
Need help writing the method: getWaitlistedIDs() – returns an array of type int[], namely the ids of students in the waitlist.
public int[] getWaitlistedIDs() {
// insert solution here and modify the return statement
return null;
}
For context
public class Course {
public String code;
public int capacity;
public SLinkedList<Student>[] studentTable;
public int size;
public SLinkedList<Student> waitlist;
public Course(String code) {
this.code = code;
this.studentTable = new SLinkedList[10];
this.size = 0;
this.waitlist = new SLinkedList<Student>();
this.capacity = 10;
}
public Course(String code, int capacity) {
this.code = code;
this.studentTable = new SLinkedList[capacity];
this.size = 0;
this.waitlist = new SLinkedList<>();
this.capacity = capacity;
}
Step by step
Solved in 3 steps with 1 images