Question: Create a C + + program named pa 1 . cpp that processes employee payroll records from a file named payroll.dat. The program

Create a C++ program named "pa1.cpp" that processes employee payroll records from a file named "payroll.dat". The program should calculate totals for gross pay, state tax, federal tax, FICA withholdings and net pay, and displays a report including these totals, along with the count of valid payroll records. The "payroll.dat" file contains payroll records for employees, each line representing one record with employee number, gross pay, state tax, federal tax, and FICA withholdings. Data fields are separated by white spaces. However, the file may contain corrupted (aka invalid) records. Discard any records that meet any of the following criteria: (1) Any data field contains a negative number; (2) The sum of state tax, federal tax, and FICA withholdings is greater than gross pay.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!