I've been trying to debug my code for a long time, and still couldn't figure out where is the mistake, could you help me, please? the program adds users input into the map until user answer "no" to the question " Do you want to add more students?" however whatever the user enters "yes" or "no" the program stop running. There could be an issue with the do/while loop, I'm not sure
//there is swith statement above and HashMap<String, ArrayList> students = new HashMap()
case 2:
ArrayList<Integer> scores = new ArrayList<>();
String name;
String answer;
do {
System.out.print("Please enter student's name: ");
name = in.nextLine();
in.nextLine();
System.out.print("Please enter " + name + "'s scores: ");
scores.add(in.nextInt());
System.out.println("Do you want to add more students yes/no?");
answer = in.nextLine();
in.nextLine();
} while (answer.equals("no"));
students.put(name, scores); //adding names and scores into HashMap<String, ArrayList> students = new HashMap()
if (answer.equals("no")) {
System.out.println("Student Quiz Scores");
keys.forEach((i) -> {
System.out.println(i + "'s quiz scores: " + students.get(i));
});
}