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. There are two types of weekly 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. Weekly employees are paid time and a half if an employee works more than 35 hours per week.

Write a Java application which will prompt the user for the employee type, followed by the employee name (first and last). You will use the String data type to read each value. The employee type will be input as a String and you will be able to convert it to a char by using the charAt() method that is part of the String class. Your program will support three different employee types: [S]alaried [H]ourly [T]emporary Your application will implement a while loop to determine if the program should continue to prompt for employee information or Quit, based on the employee type entered. After the employee name has been entered, you will use a switch statement to determine the next course of action dependent on the employee type. Your switch statement must be able to support both upper-case and lower-case characters, representing employee type. 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. Your application shall collect information for up to five separate employees. The application will use separate arrays for storing the employees first name, last name and weekly net wages. After Quit has been entered, the application will allow the user to print out the list of employees; sorted by either last name or weekly net wages (lowest to highest).

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