Question: For C++ write 4 functions pls CST 575-Programming Fundamentals for Computer Science Lab #6A Objectives Plan and code a program utillzing at least three functions
CST 575-Programming Fundamentals for Computer Science Lab #6A Objectives Plan and code a program utillzing at least three functions to solve the following problem to calculate payrol Assignment-phase 1. Develop a top-down Function 1: Create a function to input data from a user at the keyboard. See sample data below. Validate the data-hours 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: design and write a program to determine payroll information for all employees at Natural 0 through 40 hours More than 40 through 60 hours More than 60 through 80 hours regular pay 11/2 pay double pay Return the total pay for each employee. Function 3: Determine dductions (state withholding, federal withholding, union dues, and hospitalization) for each employee (as calculated in Lab 2A). Determine the gross pay (before deductions) and net pay (after deductions). Deductions are: Federal withholding Rate 18% of gross wages State Withholding Rate Union dues 45% of gross wages 2% 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, and Union dues), gross pay, and net pay. Input 3 employee initials, 7 numbers (representing the hours worked during 7 days), a pay. Error check data input from the file (by the input module). Create the data filebelow using your text editor or Notepad employee's hourly rate of Data File ABC 8.0 8.08.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 POR 10.0 10.0 80 10.0 6.0 3.0 2.0 9.75 STU 9.0 115 5.5 7.5 9.5 2.5 0.0 1150 vwx 25.0 0.0 0.0 8.5 7.5 5.5 0.0 1250 XYZ 10.0 10.0 10.0 10.0 10.0 0.0 0.0 5.00 AAA 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 Output errors to an error file Assignment Phase 2: Change the Input to be from a file. Change the error output to be to a file, not on the Payout.Txt To hand in: The structure chart, the program listing, and the output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
