Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Payroll Program Write a Payroll Program in C++ that will perform the functions specified below. 1. Print the heading NAME RATE HOURS INS SOC STATE

Payroll Program Write a Payroll Program in C++ that will perform the functions specified below. 1. Print the heading NAME RATE HOURS INS SOC STATE FED NET SEC TAX TAX 2. For each employee do the following, A. Read a line of data from a file (or from STDIN) B. Compute the gross-pay as rate times hours, if the hours is <=40. Pay double time for overtime (over 40 hours). C. Compute dollar amount of Insurance withholding as: 0.00 if status is None 9.50 if status is Single 24.75 if status is Family D. Compute social security withheld as 7% of gross pay E. Compute state tax as 3% of gross pay F. Compute PYE (Projected Yearly earnings) as gross-pay times 52. G. Compute the federal-tax based on PYE from the following table. 0% if PYE < 8000 15% if 8000 <= PYE < 20000 28% if PYE >= 20000 Using the above tax brackets, compute Federal-Tax withheld as the above percents times PYE occurring in each tax bracket. Example: if PYE is 21000 then yearly federal-tax = (20000-8000)*.15 + (21000-20000)*.28 = 1800 + 280 = 2080 H. Compute Net pay as gross-pay minus insurance minus soc-sec minus state-tax minus fed-tax I. Print a detail line with the above items Input File: 11111111112222222222333 12345678901234567890123456789012 Tom Anderson 7.52 45 N Bob Conerley 17.50 40 S John H. Potter 9.30 35 S Terrance Appleby 31.00 42 F Joseph Rinker 17.00 35 F Todd Russell 5.00 30 S Bill Ryan 18.25 45 N Your output should look similar to the following: NAME RATE HOURS INS SOC STATE FED NET SEC TAX TAX Tom Anderson 7.52 45.00 0.00 26.32 11.28 33.32 305.08 Bob Conerley 17.50 40.00 9.50 49.00 21.00 122.92 497.58 John H. Potter 9.30 35.00 9.50 22.78 9.76 25.74 257.71 Terrance Appleby 31.00 42.00 24.75 95.48 40.92 308.84 894.01 Joseph Rinker 17.00 35.00 24.75 41.65 17.85 93.52 417.23 Todd Russell 5.00 30.00 9.50 10.50 4.50 0.00 125.50 Bill Ryan 18.25 45.00 0.00 63.87 27.37 182.42 638.83 -- use setprecision(2), fixed and setw() to line up the decimals. The following code can be used to read in the data #include  #include  #include  using namespace std; int main () { char cname[20]; double rate, hours; char inscode; while (cin.get(cname,21)) // read in 20 chars { string name = cname; cin >> rate >> hours >> ws >> inscode >> ws; cout << "|" << name; cout << "|" << rate; cout << "|" << hours; cout << "|" << inscode; cout << "|" << endl; } return 0; } Additional requirements for the assignment: Steps B, C and G must be EXTERNAL functions and must be in separate files. Use the pre-processor directive #if __INCLUDE_LEVEL__ < 1 to facilitate debugging the functions. Use a consistent set of rules for indention - ie those covered in class. Turn in: The main payroll program with the output The 3 test programs for steps B, C and G 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

1. What is meant by Latitudes? 2. What is cartography ?

Answered: 1 week ago

Question

What is order of reaction? Explain with example?

Answered: 1 week ago