Question: Write an application called FavoritePlaces to get keyboard input from the user. Ask the user to enter his/her favorite place to vacation. Use this prompt.
Write an application called FavoritePlaces to get keyboard input from the user.
Ask the user to enter his/her favorite place to vacation. Use this prompt. (I suggest copy/pasting the prompt and the reply so there is no mistake)
System.out.print("Enter your favorite place to vacation: ");
Follow this specification
If the user enters "Yosemite", print "Good choice"
If the first 2 letters are "Yo" and the rest is not "semite", print "Did you mean Yosemite?"
If the user enters "Big Sur", print "mine too"
If the user enters anything else, print "I love any vacation"
The input is case insensitive so that "Big Sur" and "big sur" are treated the same.
Remember the difference between Scanner's next and nextLine methods
Use the appropriate if structure.
There is no starter file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
