Question: Define a function named GetWord Frequency that takes a vector of strings and a search word as parameters. Function GetWordFrequency() then returns the number

Define a function named GetWord Frequency that takes a vector of strings

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 words List, string currWord) 464730.3214874.qx3zqy7 LAB ACTIVITY 6.23.1: LAB: Word frequencies - functions 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 /* Define your function here */ /* Type your code here */ 8 9 int main() { 111 1 1 10 11 12 return 0; 13 } 14 0/10 main.cpp Load default template... 4.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the complete C program with an explanation include include include include using namespace std ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!