***UPDATE***
I got it to work.. but not fully. I can enter an expression like 5 + 5 and it will work. ( 5 + 5 )... will not work. And if I enter an expression without spaces it will not work.
...
Type: Posts; User: patriots1049
***UPDATE***
I got it to work.. but not fully. I can enter an expression like 5 + 5 and it will work. ( 5 + 5 )... will not work. And if I enter an expression without spaces it will not work.
...
That's excellent information to know. Thanks! I'll definitely take a look at the formatter.
But anyways, I'm just testing it out with a simple expression (8+8) ... and that doesn't work. It needs...
That's excellent information to know. Thanks! I'll definitely take a look at the formatter.
But anyways, I'm just testing it out with a simple expression (8+8) ... and that doesn't work. It needs...
This is the psuedocode provided by the teacher as well.
Algorithm evaluateInfix (infix)
// Evaluates an infix expression.
operatorStack = a new empty stack
valueStack = a new...
I would love to format it that way but my teacher is very strict on using "his" guidelines. So the way I have it formatted is the way HE thinks is best. But I did fix that stupid error on my part and...
Alright.. wow, I didn't even notice that. I fixed it now I am receiving this error:
Exception in thread "main" java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:85)
at...
Hello! I have been given the assignment to use two ( 2 ) stacks to evaluate an infix expression. I cannot switch to postfix or prefix, then solve. It has to be a direct computation. I have been...