Question
for drjava please Write a class named Employee that has the following fields: name - The name field references a String object that hold's the
for drjava please
Write a class named Employee that has the following fields:
name - The name field references a String object that hold's the employee's name
idNumber - The idNumber field is an int that hold's the employee's ID number
department - The department field references a String object that hold's the name of the department where the employee works
position - The position field references a String object that hold's the employee's job title
The class should have the following constructors:
A constructor that accepts the following values as arguments(parameters) 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(parameters) and assigns them to the appropriate fields: employee's name, employee's ID number. The department and position fields should be assigned an empty String ("").
A default no argument constructor that assigns empty Strings ("") to the employee's name, department, and position fields, and 0 to the employee's ID number.
Write appropriate mutator methods that store values in theses fields and accessor methods that return the values in these fields. Please include the appropriate toString() method for this class as well. Once you have written the class, add a main method to it that creates three Employee objects to hold the following data:
Employee Name | ID Number | Department | Position |
Susan Meyers | 47899 | Accounting | Vice President |
Mark Jones | 39119 | IT | Programmer |
Joy Rogers | 81774 | Manufacturing | Engineer |
The program should store this data in the three objects and then display (ie. output) the data for each employee.
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