import java.util.*; import java.io.*; public class QuestionsGame { // TODO: Your Code Here // Do not modify this method in any way // post: asks the user a question, forcing an answer of "y" or "n"; // returns true if the answer was yes, returns false otherwise private boolean yesTo(String prompt) { System.out.print(prompt + " (y/n)? "); String response = console.nextLine().trim().toLowerCase(); while (!response.equals("y") && !response.equals("n")) { System.out.println("Please answer y or n."); System.out.print(prompt + " (y/n)? "); response = console.nextLine().trim().toLowerCase(); } return response.equals("y"); } }