You are to write a Java program that: 1. Prompts a user to enter a \"common phra
ID: 3632075 • Letter: Y
Question
You are to write a Java program that:1. Prompts a user to enter a "common phrase", and reads it into a variable using Scanner.nextLine() - under th assumption that the phrase consists of nothing but undercase letters and spaces.
2. The following is than repeated until the entire "common phrase" is revealed:
* The "common phrase" is displayed with all of the letters (that have not yet been correctly guessed) replaced with the ? character and all of the letters that have been correctly guessed displayed as is.
* Using a user input validation loop, the second user is prompted to enter a single lowercase letter guess.
Hints:
* Store the letters that have been correctly guessed in an initially empty ("") String object, using the concatenation operator (+=).
do not use arrays