Write a C++ program that examines some
given text, displays statistics about the text, and searches the text for
a specified string. The given text consists of the five lines below.
Each line must be held in a separate string identifier and must NOT
be read in.
These are the words that we are going
to use
in the sentences that are to be examined.
Inspection shows nothing very odd
about these
lines except maybe that the word
length varies a bit. Did you
find the answers?
Your program must do each of the following tasks.
What should be found in each line? in
There are 216 total characters.
The average length of the first words
is 5.6
The remainders of the lines after the occurrence of "in" are:
g to use
the sentences that are to be
examined.
g very odd about these
es except maybe that the word
d the answers?
The average position for the first "in" is 17.4
Hand in a printout of your well-commented program and a printout showing the results of executing your program when the entered string is "th" and the results of executing your program when the entered string is "d" Also, copy the source file (the .cpp file) to the Handin folder on the P: drive for this course; i.e., copy to P:\courses\spring2002\cosc\cosc110\003\hand-in Be sure to name the .cpp file after yourself; for example, I might name something I was handing in wolfe2nd.cpp
There are several ways you may need
to try to print the results window. One way to print is with the
"Print Screen" key - Hold down the shift key and press Print Screen; this
may not output because there is no form feed at the end of the results
window. Or you may copy the entire window to the clipboard (hold
down Alt and press Print Screen); then, paste it into a document, such
as an MS Word document and print. Or mark and copy the contents of
the window to the clipboard, then paste it into a wordprocessor document
(even Note Pad can accept this) and print.