I think you never used the variable
answer
while (chips != 0 || !answer.equals("quit"))
as what I read in your code, you never write a string in that variable.
and it seems that you code is relying in
answer variable to be terminated.
Suggestion:
pls replace your while loop condition with this:
while (chips != 0)
the quit word will be the user's input right?
and you store it in
call variable of type string.
therefore the one that your program relied to to terminate is the
call variable
pls insert this line of code after
call = console.next(); that was the third line in your loop. please insert this
if(call.equalsIgnoreCase("quit")) {
System.exit(0);
}
System.exit(0); will make your code terminated. and it will check first if the user's input is "quit" (case insensitive since we used equalsIgnoreCase)
when the user's input is "quit" it will terminate your program.
here is the output in mine:
Odd or even? (type "quit" to exit) quit
BUILD SUCCESSFUL (total time: 1 second)