The problem is with the TAKER.nextInt(); method as it only reads the int value. So when compiler continue reading with TAKER.next(),the java.util.Scanner.next() method will finds and returns the...
Type: Posts; User: John Joe
The problem is with the TAKER.nextInt(); method as it only reads the int value. So when compiler continue reading with TAKER.next(),the java.util.Scanner.next() method will finds and returns the...
Add TAKER.next(); after System.out.println("enter 1 for addition, 2 - subtracton, 3 - multiplication, 4 - division.");
But I tested your code, it crashed once you enter String, no?
Output
run:
enter the numbers followed with a String to end the cycle
123
123w
ok cool lets proceed
enter 1 for addition, 2 -...
You can't input String. You are only allowed to input value with datatype int or double.