My gross keeps creeping up , 1st 5 lines are OK , then it starts going high
One how do will clear overtime or set it to 0 for next cal
Second How do I align the numbers up?
How do we count the records?
sample of textfile:
Dan Steffee 402-16-9923 45 10.70
Taylor Swift 444-13-8888 40 20.50
Chris Burrell 254-56-8999 48 17.50
Renee Lily 655-45-5555 46 18.00
Shaun Harvey 322-56-4566 50 21.00
Nicole Kidman 255-65-8898 25 12.00
Stacy Hensley 899-65-2264 38 15.00
Britney Spears 759-25-8977 28 14.50
Brad Pitt 765-45-8659 29 13.50
Jodie Foster 321-65-4565 45 13.50
Jim Jones 138-54-4684 25 12.54
Lovett Timothy 582-39-8559 37 12.50
Tom Hank 987-52-6544 50 13.54
Johnson McAdams 354-44-8888 46 21.38
Jim Weaver 123-45-6789 57 17.80
John Thomas 981-76-5432 56 12.50
Pete Gibson 897-46-5145 46 17.46
Hank Smith 546-87-2418 32 14.22
Sherry Jones 789-65-1243 28 13.75
Sharon Stone 795-82-4613 12 20.00
1 2 3 4 5 6 7 8 9 10 11 12 13
|
while (infile.eof()== false)
{if (hours>40)
overtime = hours-40;
gross =(hours-overtime)*rate+(overtime*(rate*rateo));
deductions = gross * .10;
netpay = gross - deductions;
cout<<"\n"<<ssn.substr(7)<<"\t"<<fname.substr(0,1)<<"."<<lname<<"\t"<<hours<<"\t"<<rate<<"\t"<<gross<<"\t"<<deductions<<"\t\t"<<netpay<<endl;
infile>>fname >>lname >>ssn >>hours >>rate;
}
|