Word counter: using the GETTERS and SETTERS It is required to analyse a list of
ID: 3813774 • Letter: W
Question
Word counter: using the GETTERS and SETTERS It is required to analyse a list of words, to find the number of occurrences of each word in the list. Design and implement a WordCount class holding (word, occ) pairs, where word is a string and occ is an integer. Represent that as a vector (called mywords) Provide an input operation readWords() that reads a series of words from the standard input. Provide a sort() operation that sorts the Word_Count vector in order of decreasing frequency: most frequent first. For an example of vector sorting, see http://www.cplusplus.com/reference/algorithm/sort/. If you use any ideas from this page, don't forget to reference the page in your code! Provide a print() operation that prints out the (word,occ) pairs (one per line) in the order determined by their frequencies: most frequent first.
Explanation / Answer
Design and implement a WordCount class holding (word, occ) pairs, you use any ideas from this page, don't forget to reference the page in your code! Provide a print() operation that prints out the (word,occ) pairs (one per line) in the order determined b
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.