Question: C++ For this exercise, you are to introduce a program that shows a menu of functions/activities that you want user to choose from. The menu
C++
For this exercise, you are to introduce a program that shows a menu of functions/activities that you want user to choose from. The menu will continue to ask for which function to invoke until inputting -1. Also, implement all the functions.
If input is 1: call int calculate(string exp) function. This function will return the computation of a string expression (exp). For example:
calculate(54321+222) will return 54543
calculate(120*20) will return 2400
calculate(235/3) will return 78
calculate(356-32) will return 324
If input is 2: call void getFileContent(string filename, vector& words). This function will read a text file and store each word into a vector of string. You have flexibility to determine the input parameter(s) and output type of the function.
If input is 3: call void frequencyCount(vector& words, .). This function will read the vector of string and count the frequency of each word. You have flexibility to determine the input parameter(s) and output type of the function.
For example, words = {Rockie, is, a, handsome, cat, Rockie, is cat};
Then the frequency of Rockie, is, and cat are all 2. The rests frequency are all 1.
If input is 7: call stopWordRemoval(vector& words,). This function will remove all the stop words from words, where stopwords= {a, an, the, i, we, they};
If input is -1: jump out the menu. Note that the menu should continuously take inputs until -1 is input.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
