(Using java)
My old explanation of the problem is terrible so I’ll re word it. Basically at the end of the code it should check if the user wants to rerun the program. Y == Repeat. N == End program. So why is this code not working? It is the same as what the other checks are doing but it almost seems like it skips those last two if statements. What is wrong?
String loopy = in.nextLine();
in.nextLine();
if(loopy.equals("Y")){
for(int count = 0;count<5;count++)
{
System.out.println("");
}
}
if(loopy.equals("N"))
{
break;
}
}
System.out.println("You have chosen to exit the program. Program Finished");
}}
Just swap the order of these two lines and your code will run well:
Make it: