import java.util.Scanner; class Overtime { public static void main(String[] args) { Scanner input = new Scanner(System.in); double hours, rate; double basePay, overtime = 0; System.out.print("Enter your hourly rate of pay: $ "); rate = input.nextDouble(); System.out.print("Enter the number of hours you worked this week: "); hours = input.nextDouble(); if (hours > 40) { basePay = 40 * rate; overtime = 1.5 * rate * (hours - 40); } else basePay = hours * rate; System.out.printf("Hours worked = %.2f\n", hours); System.out.printf("Hourly pay rate = %.2f\n", rate); System.out.printf("Base pay = %.2f\n", basePay); System.out.printf("Overtime pay = %.2f\n", overtime); System.out.printf("Total paycheck this week = %.2f\n", basePay + overtime); } }