here is my code in java: i used nested do-while loops
do{ //Level hard
do{ //level meduim
do{ //level easy
//LEVEL EASY
if (num==1){
//1st question
//[logic displayed]
System.out.println("Would you like to play again? Type in Y for yes or N for no ");
retake = kbd.nextLine();
} while ( retake.equalsIgnoreCase("Y"));
System.out.print("Bye! Come back soon! ^-^");
//level medium
//[logic is here]
System.out.println("Would you like to play again? Type in Y for yes or N for no ");
retake = kbd.nextLine();
} while ( retake.equalsIgnoreCase("Y"));
System.out.print("Bye! Come back soon! ^-^");
//level hard
//[level hard is the same thing as the ones on top
System.out.println("Would you like to play again? Type in Y for yes or N for no ");
retake = kbd.nextLine();
} while ( retake.equalsIgnoreCase("Y"));
}
}
the thing is when I try to retake the quiz in the hard level, it wont work. it would just display this:
Would you like to play again? Type in Y for yes or N for no
Bye! Come back soon! ^-^Would you like to play again? Type in Y for yes or N for no
but the strange thing is when I type N (no to retake) it would start the quiz the hard level how can I make it work? and why is it wrong? (please help this is due today)