A console-based RPN calculator written in Java using a custom Stack ADT. This project was created for an academic assignment to demonstrate manual stack implementation, parsing input expressions, and implementing an RPN Calculator.
The goal of this project is to evaluate mathematical expressions written in Reverse Polish Notation (RPN).
The calculator reads input from the console, processes numbers and operators using two stacks, computes the result, and prints the final output.
It continues to run until the user stops the program manually.
| Operator | Function |
|---|---|
+ |
Addition |
- |
Subtraction |
* |
Multiplication |
/ |
Division (safe with zero-check) |
% |
Modulus |
- Invalid token detection
- Insufficient operand/operator warning
- Division by zero prevention
- Program continues after errors
Custom generic stack with:
Push(E value)Pop()Peek()Length()isEmpty()invert()