Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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