Question: Part B:Write a program that will read in one line of text, a sentence, as input, and then display the following: if the sentence ends
Part B:Write a program that will read in one line of text, a sentence, as input, and then display the following:
if the sentence ends in a ?, and has an even number of characters, print "Yes"
if the sentence ends in a ? and has an odd number of characters, print "No"
if the sentence ends in a !, print "Wow"
In all other cases, write "You always say", followed by what they said, in " "
Sample Output (4 different runs)
Sentence: I dream of electric sheep
You always say"I dream of electric sheep"
Sentence: Am I right?
No
Sentence: Am I rright?
Yes
Sentence: Say hey!
Wow
Bold is user input.
Thanks so much for your help!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
