- Kurt Vincent Bautista
- Julio Carlos Tomas Ledesma
CS 112 - Section B
This simple stack-based calculator uses either an array-based or a linked list stack in performing expression evaluation. Input expression should be in postfix notation. Python 3 is required to run this program.
$ python calculator.py
OBJECTORIENTED, IMPERATIVE, QUIT: OBJECTORIENTED # Create object-oriented calculator. Use IMPERATIVE for an imperative calculator. Enter quit to exit.
Enter postfix expression: 1 2 + # 1 + 2
3 # Result
Operation | Symbol |
---|---|
Addition | + |
Subtraction | - |
Multiplication | * |
Division | / |
Modulo | % |
Exponentiation | ** |