Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

L A -r- P[N]

Answered: 1 week ago