jeudi 25 juin 2020

im doing a do while loop and prints the SOP statement always twice

           do
           {
              System.out.println("The word is: " + correct[randomSelection] + "\nYour Answer: ");
              answer = input.next();
           }   
           while(!(answer.equalsIgnoreCase("y") || answer.equalsIgnoreCase("n")));

in this code whenever I try to execute it, it always prints the sop statement twice.




Aucun commentaire:

Enregistrer un commentaire