Question: Write a program called sentenceProcessing, which reads from the user a sentence, and then produces the following: 1. Display the sentence in reverse 2. Select

 Write a program called sentenceProcessing, which reads from the user a

Write a program called sentenceProcessing, which reads from the user a sentence, and then produces the following: 1. Display the sentence in reverse 2. Select randomly a character (that is not a space) from the sentence, and then count the number of occurrence of that character in the sentence. Display the number of occurrence. 3. Count the vowels in the sentence. Display the number of vowels. 4. Display a random substring of the sentence. The starting index of the substring should be randomly selected between the second character and less than half of the sentence. The ending index should be randomly selected to be greater than half of the sentence and less than the last character in the sentence. 5. Change the character at odd positions to uppercase. Display the modified sentence. Sample run Enter a Sentence: good morning students The Sentence in reverse:stneduts gninrom doog The number of occurence of character gis 2 The number of vowels is: 6 The substring:od morning stu Modified Sentence is: gooD MORNING Students

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!