Stinclude
It include // use this if you want to read the data from a file; otherwise you can omit it using namespace std;
class Employee
private:
int id, nodependents;
char status; // 'W' salaried worker, 'A' apprentice
double hours[5]; // array to hold hours worked in a normal week
double standardrate; double SumUpHours();
double CalculatePaycheck(); // total hours times standard rate (except apprentices earn
/1 only 78.5% of the standardrate), minus deductions
double CalcDeductions(double gross); /1 Deductions are 22.0% of total pay for Federal Tax withholding, and // $75.25 for each dependent for health insurance
public:
Employee(); // the constructor. Initialize the standardrate to be 41.75
void SetPersonalData(); // stores the id number, no. of dependents, and status void InputHours(); // store the five weekday hours
double GetTotalHours();
double GetPaycheck();
};
int main()
Employee person[3];
int p;
cout.setf(ios::fixed);
cout.setf(ios::showpoint); cout.precision(2);
Plan and finish writing the main program, and all the functions, including a constructor. Use a loop in main to efficiently handle all three persons' data. Make use of all the private and public member variables and functions set up in the class definition of Employee. Read in input only from inside the functions SetPersonalData and InputHours, and write out the results only from the main program. The results should look like what's shown below.Test your program using, for example, the data
553 2 W
8.0 4.0 8.0 4.0 6.0
491
10.0
297
5.0 0 W
12.0 8.0 10.0
1 A
4.0 6.0 6.0 9.0
or any similar data. The hours don't have to be whole numbers. they could be 5.5 14.2 9.8 6.5