You have to create two classes. The first class “Employee” which included:
The private variables:
id number (Format: A#####)
The hoursWorked variable holds how many total hours the person worked. When the hoursWorked is over 40 hours, it will be considered as over time. Wage holds how much the person makes per hour. After passing the 40 hours, they get 1.5 x the wage for each additional hour worked.
GetGrossPay: calculate the gross pay for the employee (Be careful with the over time)
The second class will be “EmployeeDemo” class with the main function. In the main function, Read the data from the “employeeinfo.txt” file and save the data in the array of (Employee) objects. In the file, the first number is the total number of employees and each employee’s information.
After import the data, display a menu for user to choose:
1.Display all employees
2.Add New employee
3.Quit the program (save the information to “employeeinfo.txt” file)
John Wu A00001 $906.25 Bob Ho A00002 $420 Jenny Pena A00003 $561.88 Sam Sosa A00004 $420 Linda Jordan A00005 $1019.88