Question: Java STUDENT.JAVA public class Student { private final String name; private final int id; public Student(String name, int id) { this.name = name; this.id =
Java

STUDENT.JAVA
public class Student { private final String name; private final int id; public Student(String name, int id) { this.name = name; this.id = id; } public String getName() { return name; } public int getId() { return id; } } public void registerStudent (Student student) { // TODO: Implement. The student should be registered, but not enrolled in the class or added to the waitlist. } public void enrollStudent(int id) { // TODO: Implement. The student with the provided ID should be added the enrolled students set if there is // capacity. If there is not, but there is capacity in the waitlist, the student should be added to that // instead. If there is no capacity in the enrollment set or the waitlist, the request can be ignored. } public void dropStudent(int id) { // TODO: Implement. Attempt to remove the student with the provided ID from the enrolled students set. If the student was removed, backfill the enrolled students set with a student from the waitlist. } public ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
