Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions