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
Choose a, b, c or d as the best answer.2. Which statement would the author, most probably, agree with?
Section A Read this paragraph and answer the questions. It is widely believed that machines destroy jobs, and force the workers who did them into poverty. These beliefs have been held for hundreds of years, dating back to the Industrial Revolution. However, the fact that times of great innovation have not produced massive or long-term levels of unemployment or extensive poverty is not always understood. Unemployment remains an ongoing issue, but it should not be linked to the advance of technology. New technology can, by increasing business investment, lead to the creation of more jobs and lower unemployment. Therefore, predictions that technology will disadvantage large numbers of workers and cause widespread unemployment are unlikely to be accurate. Fill in the gap with ONE WORD from the paragraph. 1. Answer Question 1[input] about industrialisation causing job losses are not justified.
Question9Question 9Inline Choice Question Try selecting one of the choices from the drop down menu: The capital of New South Wales is [select: , Melbourne, Sydney, Tasmania, Brisbane]. ResetMaximum marks: 1 Flag question undefined
Question9Question 9Inline Choice Question Try selecting one of the choices from the drop down menu: The capital of New South Wales is [select: , Brisbane, Melbourne, Tasmania, Sydney]. ResetMaximum marks: 1 Flag question undefined
More Practical Tools for Students Powered by AI Study Helper
Making Your Study Simpler
Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!