Question: Write a program that reads a one-line sentence and then displays the following response: If the sentence ends with a question mark (?) and the

Write a program that reads a one-line sentence and then displays the following response: If the sentence ends with a question mark (?) and the input contains an even number of characters (including the ?) display the word Yes. If the sentence ends with a question mark (?) and the input contains an odd number of characters (including the ?) display the word No. If the sentence ends with an exclamation point (!) display the word Wow. In all other cases display You always say followed by the input string in quotes.

How can I find the solution by if else statment? in java.

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!