I was trying to write the following code to allow continuous coin toss and exits when E is entered. Not sure if do-while loop is the correct way to do it continuously or i should use another method.
do {
guess = sc.next();
tossGenerator(guess);
}while(!guess.equals("E")||!guess.equals("e"));
So, did I phrase the code wrongly because I can't get out of the do loop or a different method should be used. Please help. Thanks.