Savitch
Problem Solving w/ C++, 6e Instructor’s Resource Guide
Chapter 2
cout << \Union Dues withheld: \
<< UNION_DUES << endl; cout << \<< endl << endl;
cout << \another employee?”
<< “ Y/y repeats, any other ends\
cin >> ans;
} while( 'y' == ans || 'Y' == ans ); return 0; }
//A typical run:
36
Copyright ? 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Savitch
Problem Solving w/ C++, 6e Instructor’s Resource Guide
Chapter 2
14:26:48:~/AW $ a.out
Enter employee SSN (digits only, no spaces or dashes) 234567890
Please the enter hours worked and number of employees. 10 1
Employee number: 234567890 hours worked: 10.00 regular pay rate: 16.78 gross pay: 167.80
FICA tax withheld: 10.07 Federal Income Tax withheld: 23.49
State Tax withheld: 8.39 Flabbergaster's Union Dues withheld: 10.00
37
Copyright ? 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Savitch
Problem Solving w/ C++, 6e Instructor’s Resource Guide
Chapter 2
Net Pay: 115.85
Compute pay for another employee? Y/y repeats, any other ends y
Enter employee SSN (digits only, no spaces or dashes) 987654321
Please the enter hours worked and number of employees. 10 3
Employee number: 987654321 hours worked: 10.00 regular pay rate: 16.78 gross pay: 167.80
FICA tax withheld: 10.07 Federal Income Tax withheld: 23.49
38
Copyright ? 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Savitch
Problem Solving w/ C++, 6e Instructor’s Resource Guide
Chapter 2
State Tax withheld: 8.39 Health Insurance Premium withheld: 35.00
Flabbergaster's Union Dues withheld: 10.00 Net Pay: 80.85
Compute pay for another employee? Y/y repeats, any other ends y
Enter employee SSN (digits only, no spaces or dashes) 123456789
Please the enter hours worked and number of employees. 45 3
Employee number: 123456789 hours worked: 45.00
39
Copyright ? 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Savitch
Problem Solving w/ C++, 6e Instructor’s Resource Guide
Chapter 2
regular pay rate: 16.78 overtime hours worked: 5.00 with overtime premium: 1.50 gross pay: 797.05
FICA tax withheld: 47.82 Federal Income Tax withheld: 111.59
State Tax withheld: 39.85 Health Insurance Premium withheld: 35.00
Flabbergaster's Union Dues withheld: 10.00 Net Pay: 552.79
Compute pay for another employee? Y/y repeats, any other ends n
14:28:12:~/AW $
40
Copyright ? 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley