import java.util.Scanner; /** The Employee class will read in info about 2 employees and caculate * the weekly salary for each employee. */ public class EmployeeV1 { public static void main(String[] args) { // Step 1: Read in name, hours, rate for employee 1 String name; double hours, rate; Scanner sc = new Scanner(System.in); System.out.println("Enter employee name: "); name = sc.nextLine(); System.out.println("Enter hours and rate: "); hours = sc.nextDouble(); rate = sc.nextDouble(); System.out.println("Name: " + name + " hours: " + hours + " rate: " + rate); // Step 2: Calculate gross pay double pay; if (hours <= 40) { pay = hours * rate; } else { pay = 40 * rate + (hours-40)*1.5*rate; } System.out.println("gross pay is: " + pay); // Step 3: Subtract taxes from pay if (pay >= 1000){ pay -= .15 * pay; } else { pay -= .10 * pay; } System.out.println("net pay is: " + pay); // Do the same thing for second employee // Step 1: Read in name, hours, rate for employee 2 System.out.println("Enter second employee name: "); sc.nextLine(); // skip the \n in the input buffer name = sc.nextLine(); System.out.println("Enter hours and rate: "); hours = sc.nextDouble(); rate = sc.nextDouble(); System.out.println("Name: " + name + " hours: " + hours + " rate: " + rate); // Step 2: Calculate gross pay if (hours <= 40) { pay = hours * rate; } else { pay = 40 * rate + (hours-40)*1.5*rate; } System.out.println("gross pay is: " + pay); // Step 3: Subtract taxes from pay if (pay >= 1000) { pay -= .15 * pay; } else { pay -= .10 * pay; } System.out.println("net pay is: " + pay); } }