Question: Create a project for these two files as well as a driver class Main java that tests them. Postfix.java contains the methods convertTo Postfix(String infix)






Create a project for these two files as well as a driver class Main java that tests them. Postfix.java contains the methods convertTo Postfix(String infix) and evaluate Postfix(String postfix), which both need to be implemented. The driver program should be able to pass infix equations to PostFix.convertTQPostfix) which should be returned properly converted. You do not need to test to see if an incoming String is a valid infix equation (although you are free to do so if you want). Just make sure when you are testing your program that you only pass proper postfix equations as arguments. Use the variables a, b, c, d, and/or e. | Simply need to call getValue(Character c) to retrieve the proper integer value for each variable In a more in-depth project, we would be able to change what these variables stand for, but that is beyond the scope of what we are doing here As an example, running the following code in your driver program should print out abcl+ 2 String postfix PostEix.convertToPostix"a bl c"), System.out.printlo(postfix), Systemout println PostEix.evaluateRostfix(postfix) getPrecedence(char operator) returns an int indicating the precedence of the operator passed in. The higher the int returned, the higher the order of precedence of the operator isVariable(char character) returns true if the incoming character is a variable. isOperator(char chacter) returns true if the incoming character is an operator. In your driver class, the following code should print out the value '2 public class Postfix public static String convertToPostfix(String infix) Stack!nterface
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
