This assignment asks you to test and implement algorithms given in the textbook using stacks to simulate a calculator, as follows:
Design and implement a class of infix calculators. Use the algorithms given in this chapter to evaluate infix expressions, as entered into the calculator. You must first convert the infix expression to postfix form and then evaluate the resulting postfix expression. (You will have a method that takes a given String storing the infix expression and returns a String storing the equivalent postfix expression, and another method that takes a String storing a postfix expression and returns what it evaluates to.)
Hand in printouts of your source code as well as the output of your test cases.
If you have the previous (updated) edition
Chapter 6: Programming Problem 4 (page 293): Same as above: Design and implement (and of course test) the given algorithms in Java.
Correctness counts for 40% of your grade. Test cases (which should include both "normal" and "special" cases) count for 30% of the grade. Readability counts for 30%. Choose appropriate names for your identifiers. Use comments (Javadoc style), preconditions, postconditions and indentation appropriately. Follow the programming conventions/guidelines we discussed.
Since this assignment builds upon a lab exercise, it
may be done individually or in a group of two. If done in a group (not more than two per group), hand in one copy with both your names on it.