Question: Write an interactive program Named FavoriteLetter using do...while statement that accepts a favorite letter represented as a one-letter String as input. The program then repeatedly

Write an interactive program Named FavoriteLetter using do...while statement that accepts a favorite letter represented as a one-letter String as input. The program then repeatedly prompts the user to enter a word until two consecutive words are entered that start with that letter. The program then prints a message showing the last word typed You may assume that the user will type a single-word response to each prompt. Your code should be case-sensitive; for example, if the favorite letter is a, you should not stop prompting if the user types words that start with an A. For example, the following logs represent the output from two runs of the program (User input is underlined.) Input Favoriteletter ("y |Favoriteletter ("A")i oking for two "y or two eputwords in a row. Type a word: hi Tvpe a word: bye Type a word: Type a word: Type a word: Type a word: "y" is for "yippe words in a row Type a word: I Type a word: Tove Type a word: CSET42! Type a word: AND Type a word: PROGRAMS Type a word: are Tvpe a word aIways Type a word: Type a word: Awesom t? tel
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
