Question: I need help with this programming lab! Thank you! Write a Java program named Totals that reads an input file named input1.txt, where each line

I need help with this programming lab! Thank you!

Write a Java program named Totals that reads an input file named input1.txt, where each line in the file contains an employees ID (int), hours worked (int), and rate of pay (double).

The input file looks like this:

4681 57 20.35 5932 35 19.15 7456 60 19.95 2814 39 25.20 3267 67 8.45 9548 40 22.75 6375 73 18.65 8193 43 16.85

For each employee, the program will do the following: 1) Calculate the wages as hours times rate. 2) Calculate the withholding tax as 11% of the wages. 3) Calculate the net pay as wages minus withholding tax. 4) Print the ID, hours, wages, withholding tax, and net pay.

The program will also calculate and print the total hours, total wages, and total net pay. The output of this program should look exactly like this:

ID=4681 Hours=57 Wages=$1159.95 WT=$127.59 Net Pay=$1032.36 ID=5932 Hours=35 Wages=$ 670.25 WT=$ 73.73 Net Pay=$ 596.52 ID=7456 Hours=60 Wages=$1197.00 WT=$131.67 Net Pay=$1065.33 ID=2814 Hours=39 Wages=$ 982.80 WT=$108.11 Net Pay=$ 874.69 ID=3267 Hours=67 Wages=$ 566.15 WT=$ 62.28 Net Pay=$ 503.87 ID=9548 Hours=40 Wages=$ 910.00 WT=$100.10 Net Pay=$ 809.90 ID=6375 Hours=73 Wages=$1361.45 WT=$149.76 Net Pay=$1211.69 ID=8193 Hours=43 Wages=$ 724.55 WT=$ 79.70 Net Pay=$ 644.85

Total Hours = 414 Total Wages = $7572.15 Total Net Pay = $6739.21

Write the output to a file named output.txt.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!