Question: could i get help building these methods, please Constructor Detail Notation public Notation () Method Detail evaluatePostfixExpression public static double evaluatePostfixExpression (java.lang.String postfixExpr) throws InvalidNotationFormatException
could i get help building these methods, please
| Constructor Detail |
|---|
Notation
public Notation()
| Method Detail |
|---|
evaluatePostfixExpression
public static double evaluatePostfixExpression(java.lang.String postfixExpr) throws InvalidNotationFormatException
Evaluates a postfix expression from a string to a double
Parameters:
postfixExpr - the postfix expression in String format
Returns:
the evaluation of the postfix expression as a double
Throws:
InvalidNotationFormatException - if the postfix expression format is invalid
convertPostfixToInfix
public static java.lang.String convertPostfixToInfix(java.lang.String postfix) throws InvalidNotationFormatException
Convert the Postfix expression to the Infix expression
Parameters:
postfix - the postfix expression in string format
Returns:
the infix expression in string format
Throws:
InvalidNotationFormatException - if the postfix expression format is invalid
convertInfixToPostfix
public static java.lang.String convertInfixToPostfix(java.lang.String infix) throws InvalidNotationFormatException
Convert an infix expression into a postfix expression
Parameters:
infix - the infix expression in string format
Returns:
the postfix expression in string format
Throws:
InvalidNotationFormatException - if the infix expression format is invalid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
