Question: 5. Sentence Capitalizer c++ Write a function that accepts a pointer to a C-string as an argument and capitalizes the first character of each sentence

5. Sentence Capitalizer

c++

Write a function that accepts a pointer to a C-string as an argument and capitalizes the first character of each sentence in the string. For instance, if the string argument is hello. my name is Joe. what is your name? the function should manipulate the string so it contains Hello. My name is Joe. What is your name? Demonstrate the function in a program that asks the user to input a string and then passes it to the function. The modified string should be displayed on the screen.

Assume a maximum size for the c-string and inform the user of the maximum size allowed for the sentence. DO NOT use a string object. The purpose of this homework is to practice using c-strings.

Pay attention to spacing! You should capitalize the first letter of the sentence regardless of the number of spaces that precedes it. For example:

"hello.my name is joe" should be capitalized to "Hello.My name is joe" regardless of the lack of space before "my".

"hello. my name is joe" should be capitalized to "Hello. My name is joe" even though there is more than one space before "my".

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!