(Solved) : 3 Commonly Occuring 50 Points Read Clean Text Generated Part 2 Start New Cpp File Create Q37283051 . . .
3. Most commonly occuring (50 points) Read in the clean text yougenerated in part 2 (start a new cpp file). Create a list of allthe unique words found in the entire text file (usecleanedTextTest.txt for testing). Your list should be in the formof an array of structs, where each struct has two members. Onemember contains the word, one member contains the number ofoccurrences of that word. The struct definition should look likethis: struct UniqueWord { string word; int numOccurrences; }; Thereare two sub-parts that we want to accomplish:- 1. Sort the array inascending order based on the number of occurrences. Display to theconsole the number of unique words, the 10 most frequentlyoccurring, and 10 least frequently occurring. Again, since we havenot yet covered techniques for “growing” arrays in C++, preallocateyour array to some large number. To play it safe, this could meanthe number of words in the entire input file (this is assumingworst case scenario, where every word in your input file isunique). Hint: Consider the algorithm for this before starting towrite code. Start by writing pseudocode. You need to think aboutlooking at every word in the input file and comparing it against alist of unique words. 2. Write the contents of the array to 2 newfiles named “words.txt” and “counts.txt”. Each line of the“words.txt” file will have a unique word, i.e. word1 word2 … Eachline of the “counts.txt” file will have the numOccurrences/countsfor the corresponding words, i.e. count of word1 count of word2 …Note that the words will be in the ascending order based on the thenumber of occurrences since your array is already sorted in thisfashion.
Expert Answer
Answer to 3. Most commonly occuring (50 points) Read in the clean text you generated in part 2 (start a new cpp file). Create a li…
OR