Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions