Hello Cero.Uno
You can solve this problem simply by using boolean variables. The String.equals() method returns a boolean result of true if your Strings are equal in value.
boolean loop = true;
do{
userChoice = getInput("Please make a selection");
boolean quit = userChoice.equals("q");
boolean play = userChoice.equals("p");
loop = (quit || play) == false;
while (loop == true);
This code uses the logic operators
|| and
==. Google
logic operators in Java, to find out more.
Good luck.
