Write a program that reads a one-line sentence as input and then displays the following response: If the sentence ends with a question mark (?) and the input contains an even number of characters,...


Write a program that reads a one-line sentence as input and then displays<br>the following response: If the sentence ends with a question mark (?) and<br>the input contains an even number of characters, display the word Yes. If the<br>sentence ends with a question mark and the input contains an odd number<br>of characters, display the word No. If the sentence ends with an exclamation<br>point (!), display the word Wow. In all other cases, display the words You<br>always say followed by the input string enclosed in quotes. Your output<br>should all be on one line. Be sure to note that in the last case, your output<br>must include quotation marks around the echoed input string. In all other<br>cases, there are no quotes in the output. Your program does not have to<br>check the input to see that the user has entered a legitimate sentence.<br>

Extracted text: Write a program that reads a one-line sentence as input and then displays the following response: If the sentence ends with a question mark (?) and the input contains an even number of characters, display the word Yes. If the sentence ends with a question mark and the input contains an odd number of characters, display the word No. If the sentence ends with an exclamation point (!), display the word Wow. In all other cases, display the words You always say followed by the input string enclosed in quotes. Your output should all be on one line. Be sure to note that in the last case, your output must include quotation marks around the echoed input string. In all other cases, there are no quotes in the output. Your program does not have to check the input to see that the user has entered a legitimate sentence.

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here