You must define and implement your own Stack class. The Stackclass supports standard basic stack operations, (like pop(), push()) and you can implement it with an array. You should create a class template–>generic class Stack in Java, but an integer stack would work as well. Set up a function or static method that receives a string representing a postfix expression and it returns an integer result. Your function/method uses a stack to evaluate a postfix expression (see an operand –push; see an operator -pop twice, evaluate, then push result).
Test your function/method and Stack class with the following postfix expressions by using a test driver:
17 2 3 + / 13 –
5 2 3 ^ *
2 3 2 ^ ^
Answers for the postfix expressions above:
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more