Part C Question 2 of 4: (14 marks) Implement the StaffMember and Subject classes which support the functionality described above and the following additional functionality. 1. The StaffMember class must have a list of Subjects allocated to the staff member to teach. 2. The Subject class must maintain a map of StaffMembers allocated to teach the subject along with their load allocation for the particular subject. 3. The StaffMember and Subject classes must implement the Allocatable interfaces defined below:      public interface Allocatable <T> {          public void allocate(T t);    } You only need to implement the allocate method in the Subject class. Assume it is already implemented in the StaffMember class. You can write it as public void allocate(Subject subject) { ... } 4. The allocate method of the Subject class must allocate a StaffMember using the following logic: An allocation should happen only if staff member has an unallocatedLoad greater than 0. If the unallocatedLoad of the Subject is less than the unallocatedLoad of the StaffMember: The staff member will be assigned to the subject, with a teaching load equal to the unallocatedLoad of the subject. Call the allocate method of the StaffMember class, which must add the Subject to the staff member. The unallocated load for the subject will be set to 0. If the unallocatedLoad of the Subject is greater than the unallocatedLoad of the StaffMember: The staff member will be assigned to the subject, with a teaching load equal to the unallocatedLoad of the staff member. Call the allocate method of the StaffMember class, which must add the Subject to the staff member. The unallocated load for the subject will be set to the unallocated load, minus the load just allocated to this staff member.Essay

Log in for full answers

We've collected over 50,000 authentic original questions and detailed explanations from around the globe. Log in now and get instant access to the answers!

Similar Questions

More Practical Tools for Students Powered by AI Study Helper

Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!