diff options
| author | krolxon <krolyxon@tutanota.com> | 2024-02-16 00:09:35 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2024-02-16 00:09:35 +0530 |
| commit | 29eeb5191923e2f1e590b9ad28683f7458e736b5 (patch) | |
| tree | eb602c91e380e02f00a1cb63124d9109fc99638a /Calculator.java | |
| parent | c62432ebdacb54f58b0908f11879235d15460cf0 (diff) | |
change how your interact with Parser
Diffstat (limited to 'Calculator.java')
| -rw-r--r-- | Calculator.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Calculator.java b/Calculator.java index 43804c3..7070c87 100644 --- a/Calculator.java +++ b/Calculator.java @@ -1,5 +1,6 @@ public class Calculator { public static void main(String[] args) { + GFrame frame = new GFrame("Calculator"); String expr = "(84 / 4 * 3 - 9) * 2 + 1 / 5"; // 108.2 Parser p; if (args.length == 0) { @@ -7,8 +8,7 @@ public class Calculator { } else { p = new Parser(args[0]); } - String postfix = p.toPostFix(); - // System.out.println("pfix => \t " + postfix); - System.out.println(p.evalExpr(postfix)); + System.out.println("postfix => \t " + p.getPostfix()); + System.out.println(p.eval()); } } |
