Hi Using C language, Plz help me with this hwk!
You will need to parse a file of words to determine if there is a valid time in the file. Read each “token” and see if there are any of them that have the following format:
XX:XXPM or XX:XXAM
Either one of these will constitute a valid time if the X’s are actually valid numbers. For example:
5:99PM is NOT a valid time. 5:03AM is. 14:48 is NOT a valid time, 12:15PM is (use 12-hour clock).
Use the following function prototypes:
int main (int argc, char *argv)
Main function that will open an input file and print out the final totals as seen in the sample output.
void readToken(FILE *fPtr)
This function will receive a file pointer and read a token (word) from the file to be processed by checkTime().
void checkTime(char *token)
This function will take a character string that points to a token and will check it to see if the token is a valid time. It will count the number of tokens and calculate the number of valid times. static int should be helpful here.
Improper number of parameters – try again
There were 47 tokens in the file.
3 tokens were valid times.
End of program.
this is the token.