This assignment requires you to implement a postfix calculator. Your calculator must be able to compute any expression of floating point numbers using the operands +, -, *, or / (you do not need to handle negative input numbers such as “-5”).
The essence of your calculator is a class Calculator with at least the method double calculate(String expression). Your program should be able to accept arbitrary, valid postfix expressions that use these four operators.
You must also write test code to accept input from the user and print the result. You are welcome to create either a graphical user interface or a text-based user interface.
You must also write a second test class that tests your calculator with the following inputs:
1 2 + 3 * 6 + 2 3 + / answer 3
2.2 7.0 + 3.0 * answer 27.6
1 3 5 + - answer -7
When submitting the assignment, turn in your test code and your Calculator class.
For this project, you are welcome to adapt any code from the book. I suggest you use the java.util.Stack<E> class for this project, but if you have extra time, you are welcome to implement your own stack.
Feel free to implement other methods in any of the classes which will help solve this problem.
Please thoroughly test your code and briefly discuss your testing strategy. Turn in all test code.
The assignment is due on Friday at 11:59pm. You may turn it in early. If you haven’t completed the assignment by 11:58, turn in what you have. Getting partial credit is much better then no credit.