Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question: 3. Write a complete, well-documented C program that reads several lines of text and counts and displays the occurrence of a character, or a
Question: 3. Write a complete, well-documented C program that reads several lines of text and counts and displays the occurrence of a character, or a keyword or same-length words asked by the user. Your program should implement at least the following functions (in other words, additional functions may be useful, depending on the approach used) a. int searchByLength (char text [ ] [MAX LINE LENGTH), ?nt n, int wordLen), that gets several lines of text, the number of lines of text and a lenath as input parameters and returns the number of occurrences of words with that length appearing in the text. b. int searchByword (char text[] [MAXLINELENGTH), ?nt n, char * keyword), that gets several lines of text, the number of lines of text and a keyword as input parameters and returns the number of occurrences of the keyword appearing - - in the text C. int searchByCharacter (char textl] [MAX_LINE_LENGTH], int n, char ch),that gets several lines of text, the number of lines of text and a character as input parameters and returns the number of occurrences of the character (lowercase or uppercase) appearing in the text. d. void readText (char text[] [MAX LINE LENGTH), Int n), that reads (gets) n lines of text from the user and stores them in the 2D text array Assumptions: 1- The maximum number of lines is 10. 2- Each text line might have different lengths (however, the maximum number of 3- 4- characters in any individual line is 80) The maximum number of characters in any words in the text is 20. The list of delimiters to tokenize the lines (finding words) is " , .;!" Hint: You can use a two dimensional array or an array of pointers to save the text lines
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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