question archive Write an interactive Java payroll application that calculates the net pay for a factory worker

Write an interactive Java payroll application that calculates the net pay for a factory worker

Subject:Computer SciencePrice:2.87 Bought7

Write an interactive Java payroll application that calculates the net pay for a factory worker. The program prompts the user for skill level and hours worked, as well as appropriate insurance and retirement options for the employee's skill level category. The application displays: hours worked, hourly pay rate, regular pay for 40 hours, overtime pay, total of regular and overtime pay, and the total itemized deductions. If the deductions exceed the gross pay, display an error message; otherwise, calculate and display the net pay after all the deductions have been subtracted from the gross. Save as Pay.java.

Skill Level Hourly Pay Rate ($)
1 17.00
2 20.00
3 22.00

Option Explanation Weekly Cost to Employee ($)
1 Medical Insurance 32.50
2 Dental Insurance 20.00
3 Long term disability Ins. 10.00

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

Answer:

import java.util.Scanner;
class Payroll{
private double netPay;
private int noOfHours;
private String skillLevel;
private insurance;
private retirementOption;

public Payroll(double noOfHours , String skillLevel){

this.noOfHours = noOfHours;
this.skillLevel = skillLevel;

}

public static void main(String[] args){
Scanner scn = new Scanner(System.in);
System.out.println("number of hours worked:");
noOfHours = scn.nextDouble();
System.out.println("Skill level:");
skillLevel = scn.nextLine();
System.out.println("insurance");
insurance = scn.nextLine();
if(grossPay<regularPay){
System.out.err("grossPay error");
}
else{
System.out.println(netPay);
}
}
}

Related Questions