5.40 LAB: Word frequencies - functions Define a function named GetWord Frequency that takes a vector of strings and a se

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

5.40 LAB: Word frequencies - functions Define a function named GetWord Frequency that takes a vector of strings and a se

Post by answerhappygod »

5 40 Lab Word Frequencies Functions Define A Function Named Getword Frequency That Takes A Vector Of Strings And A Se 1
5 40 Lab Word Frequencies Functions Define A Function Named Getword Frequency That Takes A Vector Of Strings And A Se 1 (248.93 KiB) Viewed 17 times
c++ please
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)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply