Question: Create a class in Java called InfixExpressionEvaluator. This class consists of: public static double evaluateInfix(String infix, int[] values) Input. Several different infix expressions will be
Create a class in Java called InfixExpressionEvaluator. This class consists of:
public static double evaluateInfix(String infix, int[] values)
- Input. Several different infix expressions will be used to test your program. The input expressions are in symbolic form (using the letters a through f, for instance, a + b * c - 9, without the double quotes)
- Input. The characters, a through f will represent symbols with values provided for each symbol. The values array provides values for any variable names in the infix expression. Index 0 provides the value for a, 1 for b, etc.
- If the parentheses of a given expression are unbalanced, the program is expected to throw an IllegalStateException
- Output. The result of the expression.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
