Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void readEmployeeData(String[] lastName,int[] hrsIn, int[] hrsOut, int[] minsIn, int[] minsOut, int[] timeIn, int[] timeOut)
- {
- Scanner input = new Scanner(System.in);
- for(int i = 0; i < lastName.length; i++)
- {
- System.out.println("Enter the employees last name. Then press the ENTER key.");
- lastName[i] = input.next();
- System.out.println("Enter the employees check-in time(hour only). Then press the ENTER key.");
- hrsIn[i] = input.nextInt();
- System.out.println("Enter the employees check-in time(minutes only). Then press the ENTER
- key.");
- minsIn[i] = input.nextInt();
- System.out.println("Enter the employees check-out time(hour only). Then press the ENTER key.");
- hrsOut[i] = input.nextInt();
- System.out.println("Enter the employees check-out time(minutes only). Then press the ENTER
- key.");
- minsOut[i] = input.nextInt();
- timeIn[i] = 60 * hrsIn[i] + minsIn[i];
- timeOut[i] = 60 * hrsOut[i] + minsOut[i];
- }
- }
- public static int[] calculateTimeWorked(int[] timeIn, int[] timeOut)
- {
- int [] totalTime = new int[10];
- for(int i = 0; i < timeIn.length; i++)
- totalTime[i] = timeOut[i] - timeIn[i];
- return totalTime;
- }
Add Comment
Please, Sign In to add comment