Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Program: Plan and code a program utilizing at least three functions to solve the following problem to calculate payroll Assignmentphase 1. Develop a top-down

C++ Program:

Plan and code a program utilizing at least three functions to solve the following problem to calculate payroll Assignmentphase 1. Develop a top-down design and write a program to determine payroll information for all employees at C++ Enterprise Function 1: Create a function to input data from a user at the keyboard. See sample data below. Validate the datahours cannot be negative. Output errors with appropriate messages to the screen. Test this module. Function 2: Calculate the pay for each employee by adding up the hours for the week. Calculate each employees total pay based on the following scale of hours worked: 0 through 40 hours regular pay more than 40 through 60 hours 1 1/2 pay more than 60 through 80 hours double pay Return the total pay for each employee. Function 3: Determine deductions (state withholding, federal withholding, union dues, and hospitalization) for each employee. Determine the gross pay (before deductions) and net pay (after deductions). Deductions are : Federal Withholding Rate 18% of gross wages State Withholding Rate 5.5% of gross wages Union dues 3% of gross wages Function 4:Output to the screen: employee initials, total hours worked, pay rate, the amount of each deduction (federal withholding, state withholding, union dues), gross pay, and net pay. Input 3 employee initials, 7 numbers (representing the hours worked during 7 days), and the employee's hourly rate of pay. Error check data input from the file (by the input module). Create the data file below using your text editor or Notepad. Data File ABC 8.0 8.0 8.0 8.0 8.0 0.0 0.0 8.75 DEF 10.0 10.0 10.0 10.0 10.0 0.0 0.0 9.75 GHI 8.0 10.0 6.0 10.0 9.0 10.0 12.0 10.00 JKL 0.0 0.0 5.0 6.0 7.0 8.0 6.0 8.75 MNO 8.0 8.0 8.0 8.0 8.0 8.0 80.0 8.00 PQR 10.0 10.0 8.0 10.0 6.0 3.0 2.0 9.75 STU 9.0 11.5 5.5 7.5 9.5 -2.5 0.0 11.50 VWX 25.0 0.0 0.0 8.5 7.5 5.5 0.0 12.50 XYZ 10.0 10.0 10.0 10.0 10.0 0.0 0.0 -5.00 AAA 0.0 0.0 0.0 25.0 1.0 0.0 0.0 15.75 Output To an output file: 3 initials , total hours worked, hourly rate of pay, amount of each of 4 deductions (federal withholding, state withholding, union dues, hospitalization), gross pay, net pay. Output valid data to PayOut.Txt Output errors to an error file. Assignment Phase 2: Use files.

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

More Books

Students also viewed these Databases questions