Question: I have the code for the main files but i dont have the code for the #include comdata.h #include empdata.h go down you will see

I have the code for the main files but i dont have the code for the #include "comdata.h" #include "empdata.h"

go down you will see the code foe main.cpp i need the code for the .h files #include "comdata.h" #include "empdata.h" they will be in seperate files file for #include "comdata.h" and file for #include "empdata.h" becasuse its structuer please give me the code for these files so the main.cpp work

Question

Develop an application using an array of structures that will determine the gross pay for any number of employees input. The company pays "straight-time" for the first 40 hours worked, double time for all hours worked in excess of 40 hours but less than 50 hours, and triple time for any hours worked over 50 hours. The program should be able to loop and input the employee's name, hours worked, and the rate of pay. Once this has been done then output this information including the gross pay in the form of a paycheck. The process starts all over again until you input an invalid rate of pay or hours worked. This means a negative rate of pay or negative number of hours worked is not acceptable. Print it out like an actual paycheck with English language representing the check amount. Prinout like a company Paycheck with format: Company Address Name: Amount: numerical Amount: English of numerical value Signature Line:

code for main.cpp

//system libraries #include #include #include using namespace std;

#include "comdata.h" #include "empdata.h"

const int THOSNDS=1000; const int HUNDRDS=100; const int TENS=10;

void payCheck(EmpData, ComData); EmpData *addLine(EmpData *, EmpData, int); void pEmpCon(EmpData *, int);

int main(int argc, char** argv) {

ComData company; EmpData worker; int size=0; EmpData *worList=nullptr;

//Input data on the company cout<<"Please enter the necessary information to fill out a check."< cout<<"Which company is this payroll for?"< getline (cin, company.comName); cout<<"Enter the street address of company:"< getline (cin, company.street); cout<<"Enter the city:"< getline(cin, company.city); cout<<"Enter the state:"< getline (cin, company.state); cout<<"Enter company zipcode:"< getline (cin, company.zip); cout<<"Enter the date this payrole is to be paid:"< getline (cin, company.date);

cout<<"Enter the employee's name: "< getline(cin, worker.empName); cout<<"Enter the hours worked this week (Max of 80):"< cin>>worker.hrsWrkd; while (cin.fail() || worker.hrsWrkd>80 || worker.hrsWrkd<=0){ cout<<"Entry not valid! Enter a non-zero positive integer less than 80!"< cin.clear(); cin.ignore(256, ' '); cin>>worker.hrsWrkd; } cout<<"Enter the rate of pay for this employee (Max of $133/hr) (0 or less to exit):"< cin>>worker.payRate; while (cin.fail() || worker.payRate>133 || worker.payRate<=0) { //validate data type and range cout<<"Entry not valid! Enter a non-zero positive integer of 133 or less!"< cin.clear(); cin.ignore(256, ' '); cin>>worker.payRate; } size++; while (worker.hrsWrkd >0 && worker.payRate>0) { prnChck(worker, company); cout< worList=addLine(worList, worker, size);

cout<<"Enter the employee's name: "< cin.ignore(256, ' '); getline(cin, worker.empName); cout<<"Enter the hours worked this week (Max of 80) (0 or less to exit):"< cin>>worker.hrsWrkd; while (cin.fail() || worker.hrsWrkd>80){ //validate range and data type cout<<"Entry not valid! Enter a non-zero positive integer less than 80!"< cin.clear(); cin.ignore(256, ' '); cin>>worker.hrsWrkd; } cout<<"Enter the rate of pay for this employee (Max of $133/hr):"< cin>>worker.payRate; while (cin.fail() || worker.payRate>133) { cout<<"Entry not valid! Enter a non-zero positive integer of 133 or less!"< cin.clear(); cin.ignore(256, ' '); cin>>worker.payRate; } size++; }

pEmpCon(worList, size);

delete [] worList;

return 0; }

void pEmpCon(EmpData *a, int size){

cout<

EmpData *addLine(EmpData *a, EmpData e, int size) { EmpData *tmp= new EmpData[size]; //create temp array if (size==1){ a=new EmpData[size]; a[size-1].empName=e.empName; a[size-1].hrsWrkd=e.hrsWrkd; a[size-1].payRate=e.payRate; } else { for (int i=0;i tmp[i]=a[i]; } delete [] a; a=new EmpData[size]; for (int i=0;i a[i]=tmp[i]; } a[size-1].empName=e.empName; a[size-1].hrsWrkd=e.hrsWrkd; a[size-1].payRate=e.payRate; } delete [] tmp; return a; }

void prnChck(EmpData e, ComData c) {

string date=c.date, holder=c.comName, payTo=e.empName, payFor="Payroll for hours worked"; unsigned short amount, tmpAmnt; char n1000,n100,n10,n1; string amtText="";

if (e.hrsWrkd<=40) amount=e.hrsWrkd*e.payRate; else if (e.hrsWrkd<=50) amount=(e.payRate*40+((e.hrsWrkd-40)*2*e.payRate)); else amount=(e.payRate*40+e.payRate*20+(((e.hrsWrkd-50)*3)*e.payRate));

tmpAmnt=amount; n1000=(tmpAmnt-tmpAmnt%THOSNDS)/THOSNDS; tmpAmnt=(tmpAmnt-n1000*THOSNDS); n100=(tmpAmnt-tmpAmnt%HUNDRDS)/HUNDRDS; tmpAmnt=(tmpAmnt-n100*HUNDRDS); n10=(tmpAmnt-tmpAmnt%TENS)/TENS; n1=(tmpAmnt-n10*TENS);

switch(n1000){ case 19:amtText+="Nineteen Thousand ";break; case 18:amtText+="Eighteen Thousand ";break; case 17:amtText+="Seventeen Thousand ";break; case 16:amtText+="Sixteen Thousand ";break; case 15:amtText+="Fifteen Thousand ";break; case 14:amtText+="Fourteen Thousand ";break; case 13:amtText+="Thirteen Thousand ";break; case 12:amtText+="Twelve Thousand ";break; case 11:amtText+="Eleven Thousand ";break; case 10:amtText+="Ten Thousand ";break; case 9:amtText+="Nine Thousand ";break; case 8:amtText+="Eight Thousand ";break; case 7:amtText+="Seven Thousand ";break; case 6:amtText+="Six Thousand ";break; case 5:amtText+="Five Thousand ";break; case 4:amtText+="Four Thousand ";break; case 3:amtText+="Three Thousand ";break; case 2:amtText+="Two Thousand ";break; case 1:amtText+="One Thousand ";break; case 0:break; default:cout<<"ERROR SWITCH n1000"< }

switch(n100){ case 9:amtText+="Nine Hundred ";break; case 8:amtText+="Eight Hundred ";break; case 7:amtText+="Seven Hundred ";break; case 6:amtText+="Six Hundred ";break; case 5:amtText+="Five Hundred ";break; case 4:amtText+="Four Hundred ";break; case 3:amtText+="Three Hundred ";break; case 2:amtText+="Two Hundred ";break; case 1:amtText+="One Hundred ";break; case 0:break; default:cout<<"ERROR SWITCH n100"< }

switch(n10){ case 9:amtText+="Ninety ";break; case 8:amtText+="Eighty ";break; case 7:amtText+="Seventy ";break; case 6:amtText+="Sixty ";break; case 5:amtText+="Fifty ";break; case 4:amtText+="Forty ";break; case 3:amtText+="Thirty ";break; case 2:amtText+="Twenty ";break; case 1:break; case 0:break; default:cout<<"ERROR SWITCH n10"< }

if (n10!=1){ switch(n1){ case 9:amtText+="Nine ";break; case 8:amtText+="Eight ";break; case 7:amtText+="Seven ";break; case 6:amtText+="Six ";break; case 5:amtText+="Five ";break; case 4:amtText+="Four ";break; case 3:amtText+="Three ";break; case 2:amtText+="Two ";break; case 1:amtText+="One ";break; case 0:break; default:cout<<"ERROR SWITCH n1"< } }

if (n10==1) { switch(n1){ case 9:amtText+="Nineteen ";break; case 8:amtText+="Eighteen ";break; case 7:amtText+="Seventeen ";break; case 6:amtText+="Sixteen ";break; case 5:amtText+="Fifteen ";break; case 4:amtText+="Fourteen ";break; case 3:amtText+="Thirteen ";break; case 2:amtText+="Twelve ";break; case 1:amtText+="Eleven ";break; case 0:break; default:cout<<"ERROR SWITCH n1"< } }

cout<<"Printing Check!"< cout<

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!