Amendments Instead of reading several lines of text, just hard-code the following text in the program myString= “The quick Brown Fox jumps over the Lazy Dog and the !##! LAZY DOG is still sleeping”. Use a very small set of text (like “Ab#C#d” ) to test/debug your program first. 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. 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. Turn in one program that contains part a and b. Output 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 Word length Occurrences 1 0 2 1 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 Accept two strings: target and source Copy from source to target; process only A-Z and a-z, converting all upper case letters to lower case and ignoring everything else. Hints: Part a. Since we have 26 letters, then we can use an array with 26 rows. Each row can hold value for the actual letter and another value for the count. //Create an two dimensional array like below. You can use char instead of int to keep track of count too! char letter_count_array[26][2]; // 26 rows & 2 columns The following statements assign to the first row, the letter ‘a’ to the first column and 5 to the second column. This represents the letter ‘a’ was used 5 times in the sentence. letter_count_array[0][0]=’a’; letter_count_array[0][1]=5;
Text book : “C How to program 8th Edition” using chapters 1 to 8
Amendments
- Instead of reading several lines of text, just hard-code the following text in the program
- myString= “The quick Brown Fox jumps over the Lazy Dog and the !##! LAZY DOG is still sleeping”.
- Use a very small set of text (like “Ab#C#d” ) to test/debug your program first.
- 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.
- 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.
- Turn in one program that contains part a and b.
Output
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
Word length Occurrences
1 0
2 1
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
- Accept two strings: target and source
- Copy from source to target; process only A-Z and a-z, converting all upper case letters to lower case and ignoring everything else.
Hints:
Part a.
Since we have 26 letters, then we can use an array with 26 rows. Each row can hold value for the actual letter and another value for the count.
//Create an two dimensional array like below. You can use char instead of int to keep track of count too!
char letter_count_array[26][2]; // 26 rows & 2 columns
The following statements assign to the first row, the letter ‘a’ to the first column and 5 to the second column. This represents the letter ‘a’ was used 5 times in the sentence.
letter_count_array[0][0]=’a’;
letter_count_array[0][1]=5;
![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 "a," two “bs," no "cs," 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
Word length Occurrences
1
2
2
3
1
2 (including tis)
6.
2
7
1
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".](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fbb7c75fa-9cac-427d-99c6-6c77231fc81c%2Ff8c44420-e850-4ec9-80ba-09a81c8365c9%2Fhkxat2d_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)