aboutsummaryrefslogtreecommitdiff
path: root/Calculator.java
blob: 031fa5739fdc2caf8c77875a7419ef5bbcecefc1 (plain)
1
2
3
4
5
6
7
8
public class Calculator {
    public static void main(String[] args) {
        String expr = "(84 / 4 * 3 - 9) * 2 + 1 / 5"; // 108.2
        Parser p = new Parser(expr);
        String postfix = p.toPostFix();
        System.out.println(p.evalExpr(postfix));
    }
}