import java.util.Scanner; public class Payroll /** This class demonstrates if stmt * The 6 relational operators are: >, <, >=, <=, ==, != * */ { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter hours and rate: "); int hoursWorked=scanner.nextInt(); double payPerHour=scanner.nextDouble(); // calculate pay double weeklySalary=0.0; if (hoursWorked > 40) { System.out.println("You worked overtime!"); // now let's calculate weekly salary with 1 1/2 pay for overtime weeklySalary = (hoursWorked-40)*1.5*payPerHour+40*payPerHour; } else { weeklySalary = hoursWorked * payPerHour; } /** this can be done, but we use the else since they are * mutually exclusive. if (hoursWorked <=40) weeklySalary = hoursWorked * payPerHour; ********/ System.out.println("Your weekly salary is: $" + weeklySalary + " for " + hoursWorked + " hours."); int x=0; if (x>100) // never put ; here System.out.println("x is bigger than 100."); } }