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.论述题
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
Which of the following trees corresponds to a potential parse of the ambiguous sentence below, with correct syntactic categories? Some diagnostics are provided.
Which of the following sentences contain two non-finite verbs? Select all that apply.
The syntactic head of a phrase is the most important element of a phrase and whose category defines the phrase's [ Select ] exponent movement distribution head . Single words or phrases that form part of a phrase but are not the head are called [ Select ] head complement dependent argument modifier . This classification can be further divided into: 1) [ Select ] arguments modifiers complements dependents heads , which have a closer relationship to the head, and are not easily reordered and 2) [ Select ] arguments complements dependents heads modifiers , which have a much looser connection to the head and can often be reordered with other [ Select ] heads modifiers complements dependents arguments . Consider the concrete example: "a strong cup of coffee" and the following diagnostics. In this example, "cup" is a [ Select ] dependent complement argument head modifier , "of coffee" is a [ Select ] argument dependent complement head modifier , "strong" is a [ Select ] argument modifier complement head dependent , and "a" is a [ Select ] modifier dependent head dependent complement .
Analyze the following sentence: The sentence contains [ Select ] 8 6 5 7 3 4 functional words, [ Select ] 2 3 1 4 5 count nouns, [ Select ] 4 5 2 1 3 mass nouns, and [ Select ] 1 5 2 3 4 adjectives.
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!