Question: Write a complete, well documented C program that reads several lines of text and prints three tables indicating: 1) the number of occurrences of each

 Write a complete, well documented C program that reads several lines

Write a complete, well documented C program that reads several lines of text and prints three tables indicating: 1) the number of occurrences of each letter of the alphabet in the complete text 2) the number of one-letter words, two-letter words, three-letter words, and so on, appearing in the complete text 3) the number of occurrences of each different word in the complete text Note that the term "complete text" used above refers to all characters in all lines of inputted text. REQUIREMENTS (AND HINTS) 1. Given several lines of text, your program should implement at least the following functions (in other words, additional functions may be useful, depending on the approach used): a) void letterAnalysis(), that gets several lines of text and the number of lines of text as input parameters and prints a table indicating the number of occurrences of each letter of the alphabet in the complete text. b) int wordLengthAnalysis(), that gets several lines of text, the number of lines of text and a length as input parameters and returns the number of occurrences of words with that length appearing in the text. The main() function should call this function with different word lengths and then prints a table indicating the number of one-letter words, two-letter words, three-letter words, and so on, in the text. The maximum word length may be assumed to be 20 letters. c) void wordAnalysis (), that gets several lines of text and the number of lines of text as input parameters and prints a table indicating the number of occurrences of each different word in the text. The program should include the words in the table in the same order in which they appear in the text. INPUT Input is a number (say, int N) and several (i.e. N) lines of text from a file (using input redirection) or from the user (using standard keyboard input). For this, first the number (N) of text lines should be read, and then each line of text should be read individually. The maximum number of lines is 10 but each text line might have different lengths (however, the maximum number of characters in any individual line is 80)

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!