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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started