Question: C++ Problem Statement: You are tasked to write a program that will count the frequency of the given words in a particular sentence or a

C++

Problem Statement: You are tasked to write a program that will count the frequency of the given words in a particular sentence or a paragraph. The program will first ask the user for a string input that is a sentence (or paragraph), then ask for N words that the user wants to search for in the sentence (or paragraph), and output the frequency for each. The sentence/paragraph must be a C-style string (array of characters ended by the null character, \0), but the array of words can be C++ strings. The N words must be entered at one time before searching to see if the words are in the sentence/paragraph. In other words, you cannot ask for a word, search its frequency and then ask for another word. You must ask for all words before searching for the words. You must use a dynamic array allocated on the heap!!! You will not be given credit for a variable length array, which is not dynamically allocated on the heap, i.e. string array[num_words]; In addition, you must not have a memory leaks (use valgrind to help)! *Note: Word frequency is case insensitive. E.g. the and The are the same.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!