5.40 LAB: Word frequencies - functions Define a function named GetWord Frequency that takes a vector of strings and a se
Posted: Sun Jul 03, 2022 11:24 am
5.40 LAB: Word frequencies - functions Define a function named GetWord Frequency that takes a vector of strings and a search word as parameters. Function GetWordFrequency() then returns the number of occurrences of the search word in the vector parameter (case insensitive). Then, write a main program that reads a list of words into a vector, calls function GetWord Frequency() repeatedly, and outputs the words in the vector with their frequencies. The input begins with an integer indicating the number of words that follow. Ex: If the input is: 5 hey Hi Mark hi mark the output is: hey 1 Hi 2 Mark 2 hi 2 mark 2 Hint: Use tolower() to set the first letter of each word to lowercase before comparing. The program must define and use the following function: int GetWordFrequency (vector<string> wordsList, string currWord)