package employeesalary; import java.util.Scanner; public class EmployeeSalary { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the number of hours worked: "); int hoursWorked = input.nextInt(); double salary = 0; if (hoursWorked <= 40) { salary = hoursWorked * 50; } else { salary = 40 * 50 + (hoursWorked - 40) * 30; } System.out.println("The salary is: " + salary); } }