Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

understand the key issues concerning international assignments

Answered: 1 week ago