Problem

Payroll Report Design a Payroll class that stores an employee’s ID number, gross...

Payroll Report

Design a Payroll class that stores an employee’s ID number, gross pay, state tax, federal tax, and FICA withholdings. The class should have a method that calculates the employee’s net pay, as follows:

net pay = gross pay - state tax - federal tax - FICA withholdings

Use the class in a program that displays a weekly payroll report. A loop in the program should ask the user for the employee ID number, gross pay, state tax, federal tax, and FICA withholdings and should pass these values to an instance of the Payroll class. The net pay should be displayed. The loop should terminate when 0 is entered for the employee number. After the data is entered, the program should display totals for gross pay, state tax, federal tax, FICA withholdings, and net pay.

Input Validation: Do not accept negative numbers for any of the items entered. Do not accept values for state, federal, or FICA withholdings that are greater than the gross pay. If the state tax + federal tax + FICA withholdings for any employee are greater than gross pay, print an error message, and ask the user to reenter the data for that employee.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT