Question: Write a C program using Microsoft Visual Studio Write a payroll program that reads employee payroll data from a file and performs payroll processing. Write
Write a C program using Microsoft Visual Studio
Write a payroll program that reads employee payroll data from a file and performs payroll processing.
Write a program that accomplishes the following
: Reads up to 100 payroll records into an array of structs from a file in the form of: firstName (string) lastName (string) hourlyRate (double) hoursWorked (double).
Calculates the gross pay (hourlyRate * hoursWorked) for each employee.
Calculates the taxes for each employee (0% tax for under $100, 10% tax for $100-$499.99, 20% tax from $500-$999.99, and 30% tax from $1,000 and above).
Calculates the net pay for each employee (gross pay - taxes).
Prints the entire employee record, gross pay, taxes, and net pay to the screen for each employee.
Use a separate function to read the employee records from a file into an array.
Use a separate function to calculate the pay for each employee.
Use a separate function to print the employee record.
Terminate the program and print an error that includes the line number in the file if any payroll records contain an error (missing or invalid data). Negative hours worked and a negative or 0 hourly rate should be considered errors.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
