Essay
Programming
Write a static method named favoriteLetter that accepts two parameters: a Scanner for the console, and a favorite letter represented as a one-letter String. The method repeatedly prompts the user until two consecutive words are entered that start with that letter. The method 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 calls to your method: (User input is underlined.)
Correct Answer:

Verified
(three solutions shown)
public static vo...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
public static vo...
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q1: While Loop Simulation<br>For each call of
Q2: Programming<br>Write a static method named sequenceSum
Q3: Programming<br>Write a static method named hasMidpoint
Q4: If/Else Simulation<br>For each call of the
Q5: Parameter Mystery<br>At the bottom of the page,
Q6: Expressions<br>For each expression in the left-hand
Q7: Assertions<br>For the following method, identify each