Question
Write a C program that determines the gross pay and net pay for each of n employees, then prints out a payroll summary report. For
Write a C program that determines the gross pay and net pay for each of n employees, then prints out a payroll summary report. For each employee, your program should prompt for the number of hours worked and the hourly rate of the worker. Once this information is entered, your program should calculate the gross pay, federal tax of 20%, and net pay for that employee. The company pays straight-time for the first 40 hours worked by each employee, and pays time-and-a-half for all hours worked in excess of 40 hours.
Your program should include 6 arrays for storing the data and reprinting the data in report form.
Array1 to store the Company Name up to 30 characters.
Array2 to store the gross pay.
<>
Array4 to store federal tax.
Array5 to store net pay.
Array6 to store employee id numbers
The dialog with the user must be as follows: (the welcome message can be designed of your own choosing)
Welcome to the Sears Payroll Calculator
Enter the Company Name: Acme House Painting
Enter the number of employees(1-50): 3
Enter the Id Number for employee 1: 305
Enter the number of hours employee 1 worked: 36
Enter the hourly rate of employee 1: 30.00
Enter the Id Number for employee 2: 177
Enter the number of hours employee 2 worked: 41
Enter the hourly rate of employee 2: 20.00
Enter the Id Number for employee 3: 214
Enter the number of hours employee 3 worked: 30
Enter the hourly rate of employee 3: 15.20
Payroll Report Acme House Painting-------------------------------
Employee 305 Gross Pay: $ |
1080.00 |
Federal Tax: $ | 216.00 |
Net Pay: $ | 784.00 |
Employee 177 Gross Pay: $ |
830.00 |
Federal Tax: $ | 166.00 |
Net Pay: $ | 664.00 |
Employee 214 |
|
Gross Pay: $ | 456.00 |
Federal Tax: $ | 91.20 |
Net Pay: $ | 364.80 |
Report Totals
-------------------
Gross Pay: $ | 2366.00 |
Federal Tax: $ | 473.20 |
Net Pay: $ | 1892.80 |
Note: The bold black text represents the "output" from your program what the user types in is indicated by the blue text above. It may not appear so, but I want the decimal places to be aligned for the Payroll Report.
Error checking/data validation is required on all number input for this program. (0 < employees <= 50; id, rate, hours > 0)
Hours, Rate, Tax, Gross, Net should be float variables; Id integer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started