Guest User

Untitled

a guest
Jul 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. public static void readEmployeeData(String[] lastName,int[] hrsIn, int[] hrsOut, int[] minsIn, int[] minsOut, int[] timeIn, int[] timeOut)
  2. {
  3.     Scanner input = new Scanner(System.in);
  4.    
  5.     for(int i = 0; i < lastName.length; i++)
  6.     {
  7.      System.out.println("Enter the employees last name. Then press the ENTER key.");
  8.      lastName[i] = input.next();
  9.      System.out.println("Enter the employees check-in time(hour only). Then press the ENTER key.");
  10.      hrsIn[i] = input.nextInt();
  11.      System.out.println("Enter the employees check-in time(minutes only). Then press the ENTER        
  12.                         key.");
  13.      minsIn[i] = input.nextInt();
  14.      System.out.println("Enter the employees check-out time(hour only). Then press the ENTER key.");
  15.      hrsOut[i] = input.nextInt();
  16.      System.out.println("Enter the employees check-out time(minutes only). Then press the ENTER
  17.                         key.");
  18.      minsOut[i] = input.nextInt();
  19.  
  20.      timeIn[i] = 60 * hrsIn[i] + minsIn[i];
  21.      timeOut[i] = 60 * hrsOut[i] + minsOut[i];
  22.     }
  23.    
  24. }
  25.  
  26. public static int[] calculateTimeWorked(int[] timeIn, int[] timeOut)
  27.         {
  28.           int [] totalTime = new int[10];  
  29.            for(int i = 0; i < timeIn.length; i++)
  30.                totalTime[i] = timeOut[i] - timeIn[i];
  31.                
  32.             return totalTime;
  33.         }
Add Comment
Please, Sign In to add comment