Write a class named Employee which has the following private
member variables:
- name (a string)
- idNumber (an int)
- department (a string)
- position (a string)
The Employee class should have the following public member
functions:
- a default constructor
- a constructor which accepts the employee name and ID number as
arguments and assigns them to the appropriate member variables
- a constructor which accepts the employee name, ID number,
department, and position as arguments and assigns them to the
appropriate member variables
Also write the appropriate accessor (getter) and mutator
(setter) functions for each of the member variables.
The employee ID number will be entered by the user in a member
function named Enter_ID and returned via its return type. Enter_ID
will call a "private" member function named Validate to validate the ID,
which will be returned to Enter_ID via a reference variable (the ID
must be greater than zero).
Add a "search" member function to the Employee class which
determines if its employee ID number and name match an ID number
and name presented to it; the member function will accept, into its
parameter list, an employee ID number and name, and will return
"true" if the employee is found, or "false" if not.
In main, create an array of 100 Employee objects using the
default constructor.
The program will repeatedly execute four menu items selected by
the user, in main:
1) In a function, store in the array of Employee objects the
user-entered data shown below (but program to allow an unknown
number of objects to be stored, up to 100).
2) In a second function, display the employee data from the
array.
3) Have the user enter an employee ID number in main and call
the "search" member function described above; if the ID is found,
display in main the associated employee data; if not found, display
in main an error message (hint: process the array in main).
4) End the program
Provide four screen prints:
- Execute menu option #1 (have the user enter the data for the
three employees shown below)
- Execute menu option #3 (have the user enter ID Number
39119)
- Execute menu option #2
- Execute menu option #3 (have the user enter ID Number
53179)
Employee data for user to enter (name; id; department;
position):
Susan Meyers; 47899; Accounting; Vice President