Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How can I fix this java program please: System.out.print(\"Enter the hours worke

ID: 3663338 • Letter: H

Question

How can I fix this java program please:


System.out.print("Enter the hours worked by employee this week: "); // prompt

hoursWorked = input.nextDouble(); // read hours worked

} // end while

if (hoursWorked > 40)// Overtime

{

grossPay = hoursWorked * hourlyRate;//multiplication

overTime = (hoursWorked-40) * (hourlyRate*20.5);


taxDeduction = grossPay * .15;

System.out.printf("federal taxes: $%.2f ", taxDeduction);

System.out.println();

  

netPay = grossPay - taxDeduction;

System.out.printf("net pay: $%.2f ", netPay);

System.out.println();


netPay = hoursWorked * hourlyRate;

System.out.println("Employee:" + getName);

System.out.printf("Hourly Rate: $%.2f ", hourlyRate);

System.out.println("Regular Hours worked:" + hoursWorked);

System.out.printf("Gross Pay: $%.2f ", netPay);

}

System.out.printf( "Enter employee name or 'quit' to exit:");

getName = input.next();

Explanation / Answer

System.out.print("Enter the hours worked by employee this week: "); // prompt
hoursWorked = input.nextDouble(); // read hours worked
  
if (hoursWorked > 40)// Overtime

{

grossPay = hoursWorked * hourlyRate;//multiplication
overTime = (hoursWorked-40) * (hourlyRate*20.5);

taxDeduction = grossPay * .15;
System.out.printf("federal taxes: $%.2f ", taxDeduction);
System.out.println();
  
netPay = grossPay - taxDeduction;
System.out.printf("net pay: $%.2f ", netPay);
System.out.println();

netPay = hoursWorked * hourlyRate;
System.out.println("Employee:" + getName);
System.out.printf("Hourly Rate: $%.2f ", hourlyRate);
System.out.println("Regular Hours worked:" + hoursWorked);

System.out.printf("Gross Pay: $%.2f ", netPay);
}

System.out.printf( "Enter employee name or 'quit' to exit:");
getName = input.next();
} // end while

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote