Question: Java program make sure to run the code after you finish and attach it here Create a stack based program StackMath that accepts a user's
Java program make sure to run the code after you finish and attach it here
Create a stack based program StackMath that accepts a user's infix or postfix expression string and displays it in the other notation along with an evaluation of this expression hint: see textbook sections and Also necessary is StackInterface.
Your program will contain the following methods, which may be in separate classes:
infixpostfix converts infix to postfix
postfixinfix converts postfix to infix
evaluatePostfix evaluates the postfix expression using a stack
evaluateInfix evaluates the postfix expression using a stack
Have your program allow the user to optionally use the classes:
LinkedStack, as outlined in Listing
ArrayStack, as outlined in Listing
Each of the above classes include these ancillary methods, at least:
pop
push
peek
isEmpty
clear
Within LinkedStack's comments, explain if toArray is should be included. Include it if so
Within ArrayStack's comments, explain if toArray is should be included. Include it if so
Program displays correct infix expression of user's postfix expression.
Program displays correct postfix expression of user's infix expression.
Program properly evaluates user's infix expression, displaying the correct result.
Program properly evaluates user's postfix expression, displaying the correct result.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
