Question
Write a program that will read from an input file two strings, then two double values. The strings will be the first and last name
Write a program that will read from an input file two strings, then two double values. The strings will be the first and last name of an employee, the two doubles will be the hours and payrate for that employee.
Calculate the employees weekly pay just as you did in assignment 6, and output the results to a file. Use weeklyData.txt and netPay.txt as your filenames.
So, if a line in the input file is:
Fred Flintstone 40.25 36.00
You would add to the output file:
Employee name: Flintstone, Fred
Hours worked: 40.25
Hourly Rate: $36.00
Gross Pay: $1453.50
Regular Pay: $1440.00
Overtime Pay: $13.50
Deductions:
Federal Tax: $290.70
Total deductions: $290.70
Net Pay: $1162.80
Use weeklyData.txt and netPay.txt as your filenames.
Summary data:
Provide the following summary data to the screen, not to the file:
#of employees (count)
Total hours worked by all employees
Average hours worked per employee (total hours / count)
Total of all taxes collected
Total of all gross pay earned
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