Question: c++ Write a CH program that uses a number of functions that manipulate strings. Each function takes as an argument a pointer to a C-string.
Write a CH program that uses a number of functions that manipulate strings. Each function takes as an argument a pointer to a C-string. The first function returns the number of words in the string. For example, if the string is I love writing computer programs. the function should return the number 5. The second function will display the average number of letters in each word. This function will be of type void. It takes the pointer to a C-string and prints out the average in the function. For example, if the string is "I love writing computer programs." the function should print out Average number of letters = 5.6." The third function should print out the number of vowels in the sentence. For example, if the string is "I love writing computer programs." the function should printout Vowels = 10." The fourth function returns a pointer to a C-string. In the function declare a pointer to a C-string and set it to the string pointed to by input parameter. Then capitalize the first letter of each word in the string. For example, if the input string is "I love writing computer programs." the function should return a pointer to the string "I Love Writing Computer Programs." Test these functions by writing a program that asks the user to input a string. The
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
