Question: yes its C programing 8.31 (Text Analysis) The availability of computers with string-manipulation capabilities has re- sulted in some rather interesting approaches to analyzing the


8.31 (Text Analysis) The availability of computers with string-manipulation capabilities has re- sulted in some rather interesting approaches to analyzing the writings of great authors. Much atten- tion has been focused on whether William Shakespeare ever lived. Some scholars find substantial evidence that Christopher Marlowe actually penned the masterpieces attributed to Shakespeare. Re- searchers have used computers to find similarities in the writings of these two authors. This exercise examines three methods for analyzing texts with a computer. a) Write a program that reads several lines of text and prints a table 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, two "b's," no es," and so on. b) Write a program that reads several lines of text and prints a table 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 'tis nobler in the mind to suffer contains 1 Word length Occurrences 0 2 2 3 1 2 (including tis) 0 2 1 6 7 Text book : "C How to program 8th Edition" Amendments 1) Instead of reading several lines of text, just hard-code the following text in the program a. myString="The quick Brown ? Fox ? jumps over the Lazy Dog and the #HI LAZY DOG IS still sleeping" b. The program should work with any value assigned to myString- c. Use a very small set of text (like "Ab#C#d") to test/debug your program first. Text book: "C How to program 8th Edition" Amendments 1) Instead of reading several lines of text, just hard-code the following text in the program a. myString="The quick Brown? Fox ? jumps over the Lazy Dog and the !##! LAZY DOG IS still sleeping". b. The program should work with any value assigned to myString. c. Use a very small set of text (like "Ab#C#d") to test/debug your program first. 2) The program should make use of a function that converts the text to lower case (need to create your own conversion logic) and then perform the analysis in the main function. Ignore any numbers, symbols or special characters, etc in the text if any. Note: It's easier to create a new string for the result instead of modifying the original string. 3) Instead of the three methods outlined in the original question, complete only part a and part b. Assume maximum length is 10 for part b. 4) Turn in one program that contains part a and b. Output 3 Original text: The quick Brown? Fox ? jumps over the Lazy Dog and the !##! LAZY DOG is still sleeping Modified text: the quick brown fox jumps over the lazy dog and the lazy dog is still sleeping Letter Count a 2 b 1 Occurrences Word length 1 2 0 1 N Required: Use two 2 dimensional arrays to emulate the tables that will capture the result of the analysis. One for part a and another for part b. Use loops to initialize the array values. Indent your code/provide comments when implementing somethings that require some logic. Do not use 26 if statements to check for each letter. Use range of the alphabet (like between the starting and ending ASCII value of the letters). Create a function that will a) Accept two strings: target and source b) Copy from source to target; consume only A-Z, a-z and space, converting all upper case letters to lower case and ignoring everything else
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
