Question: The program contains a function prototype for the function named sentenceCapitalizer. The function receives a C- string as the parameter. The function does not have

 The program contains a function prototype for the function named sentenceCapitalizer.

The function receives a C- string as the parameter. The function does

The program contains a function prototype for the function named sentenceCapitalizer. The function receives a C- string as the parameter. The function does not have any value to return. The main function reads a string from the user and then displays the string as is. It then calls sentence Capitalizer to perform the function and prints the result afterwards. Your job is to write the function definition for sentenceCapitalizer In the function body, walk through the string one position at a time. For each character in the string, determine whether it is the first letter of a sentence and capitalize it accordingly. The sentences may be separated with no spaces or any number of spaces. Your algorithm should not assume that the first letter is always one space away from the previous end of a sentence marker. An end of sentence marker could be: a period (.), a question mark (?) or an escalation point(!). Test the program with this input (including the blanks at the beginning): no, not tonight. it's a very popular place and you have to make reservations in advance. besides, it's expe nsive, and I don't have any money. The output should look exactly as follows. The text before the modification: no, not tonight. it's a very popular place and you have to make reservatio ns in advance. besides, it's expensive, and I don't have any money. The text after the modification: No, not tonight. It's a very popular place and you have to make reservation s in advance. Besides, it's expensive, and I don't have any money. #include #include #include #include using namespace std; void sentenceCapitalizer(char *userString); int main() { const int MAX_SIZE = 1024; char userString[MAX_SIZE]; //get user string cin.getline (userString, MAX_SIZE); //print userString uncapitalized cout

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!