Question: void readOption ( char &option ) . This function will read an option and return to the called function through the reference parameter. You must

void readOption(char &option).
This function will read an option and return to the called function through the reference parameter.
You must do validation to make sure that the character is E/e or Q/q and nothing other than that. Use a while loop to do this.
void encode(char encodeFileName[])
This should be a void function that takes 1 char array encodeFileName.
Declare appropriate local variables.
Call the readInput() function to read students names and lateFlag.
Call the readInput() function to read Student ID and filename.
Call the readTime() function to read the submitted time.
Fill the encodeFileName array based on the six pieces of information adding underscores between.
Start with the students names, if the assignment is late, put LATE in the filename and nothing otherwise, add the parsed Student ID, add the time, without the colon, and then finally add the filename.
For example: If late: smith_sue_LATE_5587_1824_prog2.c
If it is not late: smith_sue_5587_1824_prog2.c
Use strncpy() and strcat() functions - refer to Sections 10.4 and 10.5 C-String library functions in your zyBooks. Look at my example code file.
void readInput(char fName[], char lName[], bool &lateFlag)- overloaded function
This void function should take 2 char arrays and 1 bool variable by reference.
It reads the students first name, last name and if the assignment is late or not. Student last name (e.g. Smith)(char array). Student first name (e.g. Sue)(char array)
Make sure all character data for the students name is lowercase - you may write a function to convert a cstring to all lowercase.
If the assignment was late or not (e.g., Y or N)(bool var). Must do data validation for this.
Hint: Remember an overloaded function has the same function name but different types of parameters or the number of parameters are different.
void readInput(char parsedID[], char fileName[])- overloaded function
This void function should take 1 char array for the parsed 4 digit Student ID that will be returned and another char array for the filename.
The Student ID (e.g.,977-15-5587)(char array) is a local variable. Use the strncpy() function to copy from position 7 till the end of the string. strncpy(parsedID, stdID +7,4) will copy 4 characters from the 7th position in the stdID string to the parsedID string. Check out this example code file.
The name of the file (e.g., prog2.cpp)(char array)
void readTime(char strTime[])
This is a void function that should read the time from the user as 2 integers and return one char array by reference (that is the strTime array).
The time read from the user will be in military time (e.g..18:24 for 6:24pm)(2 ints, one for hour and one for mins). Check out this example code file to extract the numbers and convert them to a cstring. This example is not quite sophisticated. You must do data validation by checking the hours are between 0 and 24 and the minutes are between 0 and 60.
This function must do data validation for the numbers and the HH:MM format. Make sure the colon : is used to separate the mins and hours.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!