Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java application with a class name of Payroll, for the Travel Agency, that will Calculate the weekly paycheck for both Salaried and Hourly

Write a Java application with a class name of Payroll, for the

Travel Agency, that will

Calculate the weekly paycheck for both Salaried and Hourly employees.

Salaried employees will be paid 1/52 of their annual pay minus

18% withheld for federal and state taxes, as well as 4% for retirement pension.

Salaried employees do not collect overtime pay.

There are two types of Hourly employees; permanent employees and temporary weekly employees.

Permanent weekly employees will be paid their hourly rate minus 18% withheld for federal and state taxes.

Temporary weekly employees will be paid their hourly rate and are Tax Exempt.

Hourly employees are paid time and a half if an employee works more than 40hours per week.

Assignment Task(s)

You must define an enumerated type specifying the different employee types. You must define an enumerated type of EMPLOYEE_TYPE that defines the different types; Salaried, Hourly, Temporary, Quit and Unknown.

You must define a MAXIMUM_EMPLOYEE constant and set it to 4

. You must define a static method called getEmployeeType which accepts the user string input and returns the enumerated employee type.

Your application must implement a while loop to determine if the program should continue to prompt for employee information or Quit, based on the employee type entered.

The while loop must also exit automatically after the maximum number of employees have been entered.

After the employee name has been entered, you

Must use a switch statement to determine the next course of action dependent on the employee type

. Your switch statement will use the enumerated employee type as the controlling variable.

Depending on the employee type, you will prompt the user for either their yearly or hourly salary. Your application will calculate the weekly gross salary, any deductions and the weekly net salary.

Your switch statement for each employee type should only prompt for the information it needs to calculate the appropriate wages, taxes and pension (if applicable).

The output will consist of the employees name, their weekly gross pay, any deductions and their weekly net pay. If the employee is a Temporary employee, the string No Taxes Deducted should appear in the weekly net pay column.

Sample:

EnterEmployee Type [Salaried], [Hourly], [Temporary] or [Quit]: salaried

Enter Employee First Name: Robert

Enter Employee Last Name : Mitchum

Robert Mitchum's Yearly Salary: $63500

Employee : Robert Mitchum

Gross Wages : $1221.15

Taxes Withhe

ld : $219.81

Retirement Withheld : $48.85

Net Wages : $952.50

Enter Employee Type [Salaried], [Hourly], [Temporary] or [Quit]: Hourly

Enter Employee First Name: Danny

Enter Employee Last Name : Kaye

Danny Kaye's Hourly Salary: $10.50

Enter

Danny Kaye's Number of Hours: 50

Employee : Danny Kaye

Gross Wages : $577.50

Taxes Withheld : $103.95

Net Wages : $473.55

Enter Employee Type [Salaried], [Hourly], [Temporary] or [Quit]: temporary

Enter Employee First

Name: Cornelius

Enter Employee Last Name : Ryan

Cornelius Ryan's Hourly Salary: $8.50

Enter Cornelius Ryan's Number of Hours: 46

Employee : Cornelius Ryan

Gross Wages : $416.50

NO Taxes Deducted

Enter Employee Type [Salaried], [Hourly],

[Temporary] or [Quit]: sal

Unknown Employee Type, Please Reenter:

quit

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions