ive got a C++ assignment to do.
this is what it says:
Write a program in C++ that takes input from a text file specified by the user and outputs the following to the screen:
• Number of single letter words.
• The average word length for the file.
• Number of words whose word length is below the average word length for the file (small words)
• Number of words whose word length is above the average word length for the file (big words)
• The actual single letter words found (do not print duplicates, print 10 to a line)
• The actual small words found (do not print duplicates, one per line)
• The actual big words found (do not print duplicates, one per line)
A word is a series of consecutive alphanumeric characters delimited by space(s), tabs, the newline character or any other "whitespace" character. The words can also be delimited by the usual punctuation characters like “.”, “,”, “?”, “;”, “:”, .. etc.
In calculating the average word length, single letter words do not contribute to the average. If the average calculation produces a number which is not a whole number (i.e. a floating point number), truncate the number to get a whole number.
The only class that you do not have to write for this assignment is the string class from #include <string>. You may use iostream and file handling classes and objects in C++.
You will need to write a vector class. There will be at least 3 vectors (objects) used in your program (one for the single letter words, one for small words and one for big words) but only one vector class. You may write any other classes that you may need and you need to justify each one.
The vector class that you write should be general enough to be used in other contexts and both methods and attributes should permit this. The class would enable the storage of a list of items and provide access to those items.
is there anyone who could help.
thankss very much. this is due on 7th July .