Question: You have been chosen to develop a program for a company and its Department and Employees. You Are required to create three classes, Company, Department,

You have been chosen to develop a program for a company and its Department and Employees. You Are required to create three classes, Company, Department, and Employee Class,
The Company class has the following attributes: CompanyName, static Department count, ArrayList of Departments, create the constructors, accessors, mutators, and proper toString Method, you also need to create a void method called addDepartment(Department d) that adds a department to the list, a method to be written is the findDepartment(String name) that searches the list for a department name and returns the department object if found otherwise returns null, a Boolean method removeDepartment(Department d) that finds the department object in the list and removes it then returns true if it was removed and false if it was not found, and a void method switchDepartment(String ID, Department A, Department B) it finds an employee via his ID, and removes the Employee Object from Department A, and adds him to Department B make sure to edit the static attribute where it is needed.
The Department class has the following attributes: Department Name, static EmployeeCount, ArrayList of Employees, create the constructors, accessors, mutators, and proper toString Method, you also need to create a void method called addEmployee(Employee d) that adds an Employee to the list, a method to be written is the findEmployee(String ID) that searches the list for an Employee name and returns the Employee object if found otherwise returns null, a Boolean method removeEmployee(Employee d) that finds the department object in the list and removes it then returns true if it was removed and false if it was not found, make sure to edit the static attribute where it is needed.
The Employee class has the following attributes: String Employee ID, String name, String Date of Birth, int age, String DeptName, the department name should only be set when the Employee is added to that department and changed when he switches to another department.
Draw a UML class table for each class.
Bonus: Implement static company employee count.

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 Databases Questions!