HW4 The punch clock int calculateMinutes(int startHour, int startMinutes, char startAmpm, int endHour, int endMinutes, char endAmpm) { } // returns position in names where searchName was found // (or -1 if it wasn't found) int findName(char searchName[MAXNAMELEN], char names[MAXEMPLOYEES][MAXNAMELEN], int employeeCount) { } void sortByMostMinutes(char names[MAXEMPLOYEES][MAXNAMELEN], int totalMinutes[MAXEMPLOYEES], int employeeCount) { } void displayEmployees(char names[MAXEMPLOYEES][MAXNAMELEN], int totalMinutes[MAXEMPLOYEES], int employeeCount) { } // returns the final number of employees in the table (i.e. parallel arrays) int readInputFile(char names[MAXEMPLOYEES][MAXNAMELEN], char inout[MAXEMPLOYEES][4], int hour[MAXEMPLOYEES], int minute[MAXEMPLOYEES], char ampm[MAXEMPLOYEES], int totalMinutes[MAXEMPLOYEES]) { char currName[MAXNAMELEN]; char currInout[4]; int currHour; int currMinute; char currAmpm; int employeeCount = 0; while (true) { infile >> currName >> currInout >> currHour >> currMinute >> currAmpm; if (!infile) { if ( strcmp(currInout,"IN") == 0 ) { int nameIndex = findName(currName, names, employeeCount); if (nameIndex == -1) { // never heard of this employee strcmp(names[employeeCount],currName); hour[employeeCount] = currHour; minute[employeeCount] = currMinute; ampm[employeeCount] = currAmpm; totalMinutes[employeeCount] = 0; employeeCount++; } else { // heard of him before hour[nameIndex] = currHour; minute[nameIndex] = currMinute; ampm[nameIndex] = currAmpm; } } else { // must be "OUT" int nameIndex = findName(currName, names, employeeCount); int timeAtWork = calculateMinutes( hour[nameIndex],minute[nameIndex],ampm[nameIndex], currHour,currMin,currAmpm); totalMinutes[nameIndex] += timeAtWork; } } }