Question: Add sum and average into this program to calculate the net pay and then run it Make the sum and average thier own methods #include
Add sum and average into this program to calculate the net pay and then run it
Make the sum and average thier own methods #include
#include
#include
using namespace std;
class payroll
ifstream fin;
char employeeid;
char employeename;
char maritalstatus;
int hoursworked,overtime;
double hourlyrate,overtimepay,regularpay,grosspay,taxrate,taxamount,netpay;
void calculategrosspay;
void calculatetax;
void calculatenetpay;
void printheadings;
void printdata;
public: payroll;
~payroll;
void printreport; ;
payroll::payroll
fin.openpayrolldat"; CONSTRUCTOR
payroll::~payroll
fin.close; DESTRUCTOR
void payroll:: calculategrosspay
ifhoursworked
overtime hoursworked ;
regularpay hoursworked hourlyrate;
overtimepay overtime hourlyrate ;
grosspay regularpay overtimepay; IF
else grosspay hoursworked hourlyrate; CALCULATEGROSSPAY
void payroll ::calculatetax
ifgrosspay taxrate ;
else ifgrosspay taxrate ;
else taxrate ;
ifmaritalstatus Smaritalstatus s
taxrate taxrate ;
taxamount grosspay taxrate; CALCULATETAX
void payroll :: calculatenetpay
netpay grosspay taxamount; CALCULATENETPAY
void payroll::printheadings
coutemployeenameemployeeidmaritalstatushoursworkedhourlyrate
calculategrosspay;
calculatetax;
calculatenetpay;
printdata;
i; WHILE
PRINTREPORT
void main
payroll employee;
employee.printreport; MAIN
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
