Discover a world of knowledge at Westonci.ca, where experts and enthusiasts come together to answer your questions. Ask your questions and receive accurate answers from professionals with extensive experience in various fields on our platform. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.

Assignment 10 - 1/0 Streams and Files Create a C++ a program that will compute the average word length (average number of characters per word) for a text file. The text file should be chosen by the user when the program is executed. • a blank space • 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. Use the following text as a test for your program. Create a separate text file and paste the following paragraph into that file. Seeing, now, that there were no curtains to the win dow, and that the street being very narrow, the house opposite comman ded a plain view into the room, and observing more and more the inde corous figure that Queequeg made, staving about with little else but h is hat and boots on; I begged him as well as I could, to accelerate his toilet somewhat, and particularly to get into his pantaloons as soon as possible. He complied, and then proceeded to wash himself. At th at time in the morning any Christian would have washed his face; b ut Queequeq, to my Use the following text as a test for your program. Create a separate text file and paste the following paragraph into that file. Seeing, now, that there were no curtains to the win dow, and that the street being very narrow, the house opposite comman ded a plain view into the room, and observing more and more the inde corous figure that Queequeg made, staving about with little else but h is hat and boots on; I begged him as well as I could, to accelerate his toilet somewhat, and particularly to get into his pantaloons as soon as possible. He complied, and then proceeded to wash himself. At th at time in the morning any Christian would have washed his face; b ut Queequeg, to my amazement, contented himself with restricting his a blutions to his chest, arms, and hands. He then donned his waistcoa t, and taking up a piece of hard soap on the wash-stand centre table, dipped it into water and commenced lathering his face. I was watching to see where he kept his razor, when lo and behold, he takes the harpoon from the bed corner, slips out the long wooden stock, unsheathes the head, whets it a little on his boot, and striding up to the bit of mirror against the wall, begins a vigorous scraping, or rather harpoon ing of his cheeks. Thinks I, Queequeg, this is using Rogers's best cut lery with a vengeance. Afterwards I wondered the less at this o peration when I came to know of what fine steel the head of a harpoon is made, and how exceedingly sharp the long straight edges are alway s kept.

Sagot :

Answer:

dgvky

Explanation: