Question: Write a program that calculates the average word length of a sentence. Your program should start by asking the user for a sentence. Then it
Write a program that calculates the average word length of a sentence.
Your program should start by asking the user for a sentence. Then it should calculate the average word length of the sentence. Your program should consider punctuation as part of the word to which it is attached. The output should be displayed to one decimal place.
Hints: For this program youll need a loop, inside of which there should be 2 or 3 IF/ELSE IF statements. You should also use the following functions:
getchar(): Pulls the next character from the CIN input buffer for analysis. An example can be found on tutorialspoint.com (link below).
Must use #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
