import java.util.Scanner; public class Payroll3 /** This class demonstrates * */ { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int numEmployees=3; //use this as my limit for my counter int counter=0; // REPEAT the next 20 lines 3 times while(counter < numEmployees) { counter++; System.out.printf("Enter hours and rate for employee #%d: ",counter); 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; } System.out.printf("Your weekly salary is: $%.2f. You worked %d " + "hours at %.2f rate.\n", weeklySalary,hoursWorked, payPerHour); } } }