For this program you will be implementing a simple decimal calculator. By simple I mean it only need to support the binary operators +, -, *, and / with their standard definitions (i.e., addition, subtraction, multiplication, and division) and parenthesis. Multiplication and division have higher precedence than addition and subtraction, all of them have left to right associativity, and parentheses can be used to override the precedence.
The program will accept a string containing the expression to be evaluated and print the result of evaluating the expression. Some simple example are:
>2*3
6.0
>2*3.5-2
5.0
>2*(3.5-2)
3.0
You should evaluate the expression in a single left to right scan of the input string, using an operator and an operand stack to hold intermediate results during the evaluation. You may handle parenthesis either by a recursive call or by using the stack. You can ignore space completely in the user input. Consider any characters other than 0-9, ., +, -, *, and / as an error. Numbers can be integers (e.g., 2, which is 2.0) or reals (e.g., 2.0). You don't have to worry about scientific notation for inputs. You don't have to worry about negative numbers for inputs they are most easily handled using unary -, which we don't have.
You might consider developing your code in steps like we did in class.
Since Python version 2.4, it has included support for decimal floating point arithmetic. See Section 9.4. decimal Decimal fixed point and floating point arithmetic in the Python 2.7.10 reference manual or Section 9.4 Decimal fixed point and floating point arithmetic in the Python 3.5.0 reference manual.
include a report describing the problem, your approach to solving it (pseudo code, etc), the source code, and sample outputs. Your report should cite any sources of materials you used in solving the problem.