Question: Write a Java library (use a package) to support a Company Directory. The Company Directory tracks the following information about a person: First name Last

Write a Java library (use a package) to support a Company Directory. The Company Directory tracks the following information about a person:

First name

Last name

Telephone number

Email address

Employee Number (must be unique).

Get the persons role (determined as Executive, Manager,

Worker).

Employees of the company fall into one of three categories:

1. Executives 2. Managers 3. Workers

Each worker is assigned to a specific department. Each manager has a number of direct reports (e.g. directReports = 5).

Each executive has a number of managers that report to the executive and a number of indirect reports (workers) that he/she is responsible for (e.g. directReports = 2, indirectReports = 12).

The Company Directory should support the following operations:

1. Add Worker

2. Delete Worker (by employee number)

3. Add Executive 4. Delete Executive (by employee number)

5. Add Manager

6. Delete Manager (by employee number)

7. Print all Workers, sorted by Last Name, First Name 8. Print all Executives, sorted by Last Name, First Name 9. Print all Managers, sorted by Last Name, First Name 10. Print the entire company directory, sorted by Last Name, First

Name. The role of the person (Executive, Manager, Worker)

should be displayed for each person. 11. Add a new Worker, Executive, or Manager using an existing

Worker, Executive, or Manager object (clone). 12. Assume that you would like to read and write these objects

to a database. Executives can be read from a database but cannot be written. Managers can be written to a database but cannot be read from the database. Workers can be read from or written to a database. Make sure your program would be able to support this functionality.

You should use override toString(), implement Comparable, and implement Cloneable in your solution to solve this problem effectively.

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!