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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!