public class Calculator
extends java.lang.Object
Constructor and Description |
---|
Calculator() |
Modifier and Type | Method and Description |
---|---|
static double |
evaluate(java.lang.String infix)
This method will evaluate an infix arithmetic expression.
|
static double |
evaluatePostfix(java.lang.String postfix)
This method will evaluate a postfix arithmetic expression.
|
static java.lang.String |
infixToPostfix(java.lang.String infix)
This method will convert an arithmetic expression from infix to postfix notation
|
public static double evaluatePostfix(java.lang.String postfix)
postfix
- expression in String, tokens are separated by space.java.lang.ArithmeticException
- exception with appropriate messagepublic static double evaluate(java.lang.String infix)
infix
- expression Stringjava.lang.ArithmeticException
- exception with appropriate messagepublic static java.lang.String infixToPostfix(java.lang.String infix)
infix
- is a string of arithmetic expression in infix notation.java.lang.ArithmeticException
- exception with appropriate message