Question
Write a Java program. Have the user input an infix expression, for example: (5+7)+3+(6*4*3)+((7+4)*3) Your program should output an equivalent postfix expression: 5 7 +
Write a Java program.
Have the user input an infix expression, for example: (5+7)+3+(6*4*3)+((7+4)*3)
Your program should output an equivalent postfix expression: 5 7 + 3 + 6 4 * 3 * + 7 4 + 3 * +
(no guarantee that the above is the only correct solution)
You should use the parser you wrote in the first homework and add in open and close parenthesis.
The only mathematical operations you need to worry about are +, -, *, and /.
The input string should conform to the requirements of your parser (maybe you need a space before and after an operator, number or parenthesis.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started