1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
int main() {
payroll *employee[6], *report;
char alastname[14],lastname[14], ams, apaystatus;
int aemployeeid,n, i=0;
double ahoursworked, ayearlysalary, ahourlyrate, minnp, maxnp, ataxamount, anetpay, aovertimepay, taxamount, netpay, overtimepay;
report->printheaders();
ifstream fin;
fin.open("2142011.in");
while (fin>>alastname>>aemployeeid>>ams>>apaystatus>>ahoursworked>>ahourlyrate>>ayearlysalary) {
if (apaystatus == 's') {
employee[i] = new salaried();
employee[i]->settingthevariables(alastname, aemployeeid, ams, apaystatus, ahoursworked, ahourlyrate, ayearlysalary, ataxamount, anetpay, aovertimepay);
employee[i]->findgrosspay(); }
if (apaystatus == 'h') {
employee[i] = new hourly();
employee[i]->settingthevariables(alastname, aemployeeid, ams, apaystatus, ahoursworked, ahourlyrate, ayearlysalary, ataxamount, anetpay, aovertimepay);
employee[i]->findgrosspay();}
employee[i]->findtaxamount();
employee[i]->findnetpay();
employee[i]->sortdata(lastname,overtimepay, taxamount,netpay);
minnp = employee[i]->minnet(minnp, i);
maxnp = employee[i]->maxnet(maxnp, i);
employee[i]->printdata();
i++;
}
|