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;


Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images









