Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c++ and test on gtest 0 3 of 5 a Assignment_1_Spr2020.pdf 78.3% Q - X Q2: Text Analysis The availability of computers with string-manipulation capabilities
c++ and test on gtest
0 3 of 5 a Assignment_1_Spr2020.pdf 78.3% Q - X Q2: Text Analysis The availability of computers with string-manipulation capabilities has resulted in some rather interesting approaches to analyzing the writings of great authors. This exercise examines three methods for analyzing texts with a computer. You have to use char * for the following exercises. 1. Write a function that receives a string consisting of several lines of text and returns an array indicating the number of occurrences of each letter of the alphabet in the text. For example, the phrase "To be, or not to be that is the question": contains one "a," two "b's." no "c's," and so on. 1 void count Letters (char *string int *&array, int & size) 2 Parameters: 3 Input: 4 char *: a multiline string 5 Output: 6 int *: an array containing counts of each letter, 7 to be allocated in function 8 int : array size */ 91 10 2. Write a function that receives a string consisting of several lines of text and returns an array indicating the number of one-letter words, two-letter words, three letter words, and so on, appearing in the text. For example, the phrase "Whether this nobler in the mind to suffer contains 2. 3. 4. etc. length words. 1 void count Words Base dOnLength(char *string int *array/*to be allocated */ 2 int & size /* updated array size*/) 3 Parameters: 4 Input 5 char * : a multi-line string 6 Output: 7 int*: an array containing counts of each different length words, 8 to be allocated in function 9 int : array size */ 10 { 11 3. Write a function that receives a string consisting of several lines of text and returns arrays indicating unique words and the number of occurrences of each unique word in the text along with their size. 1 void counting Unique Words (char *string , char **&uwords/ list of unique words:*/ 2 int *karray /*to be allocated */ int & size /*updated array size*/) 3 Parameters 4 Input 5 char * : a multiline string 6 Output: 7 char **: an array of unique words 8 int *: their counts 9 int : number of unique words */ 10 1 11 }Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started