I am creating a program that will calculate a math equation similar to (5+5) + 6*3 + 18. It works when I put spaces between the integers and operators, however if there is no space it gives me a stack error. I know its because I am using s.nextInt(); for numbers and s.next() for the operators and if there is no space s.next() will pull everything till you get to a space. Any suggestions on how to fix this. Line 57 is my error because of an empty stack. The input is read between 17-24.
Thanks in advance!
Thanks in advance!