Question: Write a program that will compute the average word length (average number of characters per word) for a file that contains some text. A word

"Write a program that will compute the average word length (average number of characters per word) for a file that contains some text. A word is defined to be any string of symbols that is preceded and followed by one of the following at each end: a blank, a comma, a period, the beginning of a line, or the end of a line. Your program should define a function that is called with the input-file stream as an argument. This function should also work with the stream "cin" as the input stream, although the function will not be called with "cin" as an argument in this program."

I need help with this question that I have been struggling on for a while. Please help, and have the answer in c++ language in addition to screenshots of the code running successfully. Thank you in advance.

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!