Answered step by step
Verified Expert Solution
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 addDepartmentDepartment d that adds a department to the list, a method to be written is the findDepartmentString name that searches the list for a department name and returns the department object if found otherwise returns null, a Boolean method removeDepartmentDepartment 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 switchDepartmentString 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 addEmployeeEmployee d that adds an Employee to the list, a method to be written is the findEmployeeString ID that searches the list for an Employee name and returns the Employee object if found otherwise returns null, a Boolean method removeEmployeeEmployee 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started