Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions