Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA programming through eclipse. This is an introduction class so the code is fairly simple. Write a payroll processing program. Input will be from a

JAVA programming through eclipse. This is an introduction class so the code is fairly simple.

Write a payroll processing program. Input will be from a file called weeklyData.txt. You may create this file on your own for testing purposes, but I have provided a file with 75 employees that I will use to test your code. Each line in the file contains information about one employee. Each item is separated by a space. The items are, in order:

First Name

Last Name

Hourly wage rate (decimal)

Hours

worked (decimal)

# of dependents (whole number)

For each employee listed in this file, read the above data and produce the following detail data:

Regular hours worked and overtime hours worked

Regular pay and overtime pay and gross pay

Insurance deduction

and Income tax deduction

Net pay

Calculations:

Overtime hours are all hours over 40, the rest are regular hours

Regular pay is the regular hours times the wage rate

Overtime pay is 1.5 times the overtime hours times the wage rate

Gross pay is regular pay plus overtime pay

Insurance is determined by the number of dependents:

0 is $25.19

1 is $39.02

2 or more is $50.63

Income tax is calculated as follows:

The first $300 dollars is not taxed

The next $500 is taxed at 5% of gross

Everything over $800 is taxed at 8.5% of gross

Net pay is gross pay minus the two deductions(tax and insurance)

The detail output should be to a file called payroll.txt formatted nicely, and include the three input

values as well as all calculated values. Separate each employees detail data in the file as you see fit

Here are two lines of a sample input file

Kelvin Fowler 37.45 40.00 1

Shea Torres 31.19 49.75 4

and suggested output:

Pay stub for Fowler, Kelvin (Dependents: 1)

Hours: 40.00 (regular: 40.00 Overtime: 0.00)

Hourly Rate: $37.45

Gross pay: $1498.00 (Regular: $1498.00 Overtime: $0.00)

Deductions:

Insurance: $39.02

Taxes: $84.33

Total Deductions: $123.35

Net Pay: $1374.65

**************************************

Pay stub for Torres, Shea (Dependents: 4)

Hours: 49.75 (regular: 40.00 Overtime: 9.75)

Hourly Rate: $31.19

Gross pay: $1703.75 (Regular: $1247.60 Overtime: $456.15)

Deductions:

Insurance: $50.63

Taxes: $101.82

Total Deductions: $152.45

Net Pay: $1551.30

***********************************

Here are two lines of a sample input file

Kelvin Fowler 37.45 40.00 1

Shea Torres 31.19 49.75 4

and suggested output:

Pay stub for Fowler, Kelvin (Dependents: 1)

Hours: 40.00 (regular: 40.00 Overtime: 0.00)

Hourly Rate: $37.45

Gross pay: $149

8.00 (Regular: $1498.00 Overtime: $0.00)

Deductions:

Insurance: $39.02

Taxes: $84.33

Total Deductions: $123.35

Net Pay: $1374.65

*************************

Pay stub for Torres, Shea (Dependents: 4)

Hours: 49.75 (regular: 40.00 Overtime: 9.75)

Hourly Rate: $31.19

Gross pay: $1703.75 (Regular: $1247.60 Overtime: $456.15)

Deductions:

Insurance: $50.63

Taxes: $101.82

Total Deductions: $152.45

Net Pay: $1551.30

*************************

Summary data should include the following (andshould be printed at the end of the detail data in the output file, as well as to the screen

# of employees

Total payroll (sum of all gross pay), and of that how much was overtime

Total hours worked, and of that how many were overtime hours

Total insurance premiums

Total taxes withheld

Sample summary from detail data above:

# of employees: 2

Total hours: 89.75

Overtime hours: 9.75

Total gross pay: $3201.75

Overtime pay: $456.15

Total insurance withheld: $89.65

Taxes withheld: $186.15

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

Step: 3

blur-text-image

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

2. What should an employer do when facing an OSHA inspection?

Answered: 1 week ago

Question

Who was the first woman prime minister of india?

Answered: 1 week ago

Question

Explain the concept of going concern value in detail.

Answered: 1 week ago

Question

Define marketing.

Answered: 1 week ago

Question

What are the traditional marketing concepts? Explain.

Answered: 1 week ago