Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Employee Class Write a class named Employee that has the following fields: . nam

ID: 440687 • Letter: E

Question

Employee Class Write a class named Employee that has the following fields: . name. The name field is a String object that holds the employee's name. .idNumber. The idNumber is an int that holds the employee's ID number. . department. The department field is a String object that holds the name of the department where the employee works. . position. The position field is a String object that holds the employee's job title. The class should have the following constructors: . A constructor that accepts the following values as arguments and assigns them to the appropriate fields: employee's name, employee's ID number, department, and position. .A constructor that accepts the following values as arguments and assigns them to the appropriate fields: employee's name and ID number. The department and position fields should be assigned an empty string (""). . A no-arg constructor that assigns empty strings ("") to the name, department, and position fields, and 0 to the idNumber field. Write appropriate mutator methods that store values in these fields and accessor methods that return the values in these fields. Your interface program should create three Employee objects to ask the user for name, Id number, Department and Position for each employee. The program should store this data in the three objects and then display the result for each employee on the screen. See the following sample output:

Explanation / Answer

It sounds like you need 3 constructors. The first two you have are correct, the third should only have two parameters (name and ID) and should assign an empty string for department and position. Mutator and accessor methods simply allow you to retrieve/assign values from/to specific fields. In the case of ID you should do something like this: // Accessor public int getIDNumber() { return IdNumber; } // Mutator public void setIDNumber(int id) { IdNumber = id; } Repeat this pattern for each of your fields. Finally write a main method which instantiates Employee objects with the data it tells you (Employee e1 = new Employee(...)). Then use your accessor methods to print out the employee's data.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote