Question: cdn . com / 5 e 0 1 7 c 6 ea 5 a 6 1 / 1 8 4 0 0 7 1 9
cdncomeceaaXBlackboardSBucketlearnuseastprodfleetxythos & X
Maps
employee, an executive's yearlyPayment should be increased by 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 addEmployee 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 transferDepartment 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
