Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please I want to write this program in C++ language. not allowed to use arrays or global variables. This program is an exercise in using

please I want to write this program in C++ language. not allowed to use arrays or global variables.

This program is an exercise in using loops and functions that pass values in both directions (to and from a function). You will calculate the payroll of several employees at a company. After processing the employees information, you will provide a payroll summary. This program is to use both input and output files.

INPUT (for each employee)

Employee number

Hourly wage

Hours worked

CALCULATIONS

Employee gross pay is hours worked multiplied by hourly wage.

If hours worked for an employee are 35 or less then the employee receives a $.15 per hour bonus. Show this in the output by displaying an asterisk * after their hours worked.

If hours worked for an employee are more than 40 hours then they receive 1.5 times their wages for hours worked over 40 hours. Show this in the output by displaying a $ after their hours worked.

State tax is 5.42 percent (.0542) of the employee gross pay.

Social Security tax is 7 percent (.07) of the employee gross pay.

Federal tax is 16 percent (.16) of the employee gross pay.

Net pay is the gross pay minus the taxes of state, federal, and social security.

Totals for gross pay, state tax, federal tax, and social security tax will need to be printed for the company.

SAMPLE INPUT FILE

1121 15.12 40

9876 9.50 47

3333 22.00 35

2121 5.45 43

9999 10.00 25

(20%) SAMPLE OUTPUT FILE

Employee Payroll

Employee Hours Rate Gross Net Fed State Soc Sec

1121 40 15.12 604.80 432.91 96.77 32.78 42.34

9876 47$ 9.50 479.75 343.41 76.76 26.00 33.58

3333 35* 22.00 775.25 554.92 124.04 42.02 54.27

2121 43$ 5.45 242.53 173.60 38.80 13.15 16.98

9999 25* 10.00 253.75 181.64 40.60 13.75 17.76

SUMMARY Totals for All Employees

Gross Pay Net Pay Federal Tax State Tax Soc Security

2356.08 1686.48 376.97 127.70 164.93

(10%) Output must line up in columns as shown above. This includes numbers to be lined up under headings (right justified)

(5%) Check if your program works correctly by running with the sample data above

(5%) I will do a final run using my data.

GENERAL REQUIREMENTS

You must use main() and at least three additional functions: process_payroll(), process_employee(), and print_summary().

(10%) The function process_employee() performs the following tasks:

Reads the individual employee payroll information

Returns the value read using parameters

Function returns (one 1) if employee information is read successfully or (zero 0) if employee information is not read successfully.

(10%) The function process_payroll() performs the following tasks:

Print Employee Payroll header message

Print the headings for the columns (Employee, Hours, Rate, etc.)

Call process_employee() [from inside a loop] until 0 is returned

For each employee calculate and record:

Gross pay, net pay, fed tax, state tax, soc security

Update the variables required to print summary

Print out one line for each employee as shown

(10%) The function print_summary() performs the following tasks:

Print out the Summary message line

Prints out the column headings (Gross Pay, Net Pay, etc.)

Prints out the totals which have been accumulated (running total kept)

(5%) Make up variable names that are meaningful.

(5%) Indent consistently and use white space (blanks and blank lines) appropriately.

(5%) Have a block comment at the start of your program with name, etc.

(5%) Have a block comment before each function with the function name and a short description.

(5%) Use additional comments as necessary.

(5%) Use symbolic constant values such as federal tax (e.g. const float FEDERAL_TAX = 0.16;)

(5%) Prototype your functions.

(5%) Do NOT use global variables

In C++

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

Students also viewed these Databases questions

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago