Question: Write an Employee class with the following fields: name: A String representing the employee s name. idNumber: An int representing the employee s ID number.

Write an Employee class with the following fields: name: A String representing the employees name. idNumber: An int representing the employees ID number. department: A String representing the department where the employee works. position: A String representing the employees job title. The Employee class should include the following constructors: 1. A constructor that accepts values for all four fields (name, ID, department, and position) and assigns them to the corresponding fields. 2. A constructor that accepts only the name and idNumber, setting department and position to empty strings ("").3. A no-argument constructor that initializes name, department, and position to empty strings and idNumber to 0. The class should also provide appropriate accessor (getter) and mutator (setter) methods for each field. Additionally, write a separate EmployeeTest class to test the Employee class. The EmployeeTest class should: Create three Employee objects with the following specified data: o Employee 1: name = "Susan Meyers", idNumber =47899, department = "Accounting", position = "Vice President" o Employee 2: name = "Mark Jones", idNumber =39119, department ="IT", position = "Programmer" o Employee 3: name = "Joy Rogers", idNumber =81774, department = "Manufacturing", position = "Engineer" Use the accessor methods to retrieve and display the information for each employee in a clear format. Demonstrate the program by running EmployeeTest and observing the output to verify the functionality of the Employee class.

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