Question: cdn . com / 5 e 0 1 7 c 6 ea 5 a 6 1 / 1 8 4 0 0 7 1 9

cdn.com/5e017c6ea5a61/18400719?X-Blackboard-S3-Bucket=learn-us-east-1-prod-fleet01-xythos & X
Maps
34
100%
employee, an executive's yearlyPayment should be increased by 20,000 dollars for each promotion.
Class Department:
Create a class called Department. A department should have the following four attributes:
departmentName: the name of the department.
capacity: a constant value to indicate the maximum number of employees that this department can hire.
numMember: an integer value to indicate the number of employees currently in this department.
roster: an array that holds all of the employee objects who work in this department.
Tasks:
Add a constructor
Add a get method for each attribute.
Add a method called add(Employee e) that can add an employee (can be a regular employee, an hourlyPaidEmployee, or an executive) to the department. Assign this department to the employee object's department attribute. Throw the IndexOutOfBoundsExecption if the number of employees has exceeded maximum capacity for the department.
Add a method called transfer(Department other, Employee e) that can transfer the given employee from the department to the other specified department. If the other department has reached its capacity limit, then throw the illegalStateException. If the given employee is not in the department then throw the NoSuchElementException.
Implement Iterable and Iterator interfaces After you implement those wo interfaces, you should be able to loop through each employee object in this department
Again, you may add additional private utility methods to facilitate your design
cdn . com / 5 e 0 1 7 c 6 ea 5 a 6 1 / 1 8 4 0 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!