import java.util.Scanner;
/** The Employee class will read in info about 2 employees and caculate
  * the weekly salary for each employee. 
  */
public class EmployeeV2 {
 public static void main(String[] args) {
   int numEmployees = 2;
   String name;
   double hours, rate;
   Scanner sc = new Scanner(System.in);
   int count = 1;
   while (count <= numEmployees) {
     
      // Step 1: Read in name, hours, rate for employee 1
      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);
      sc.nextLine(); // skip '\n' in input buffer
      count++;
   }// end whle loop
 }
}