Write a program that takes as input an infix expression and outputs the equivalent postfix expression. The

Question:

Write a program that takes as input an infix expression and outputs the equivalent postfix expression. The basic algorithm is contained in “Translating Infix to Postfix Notation” on page 348. Assume that the input may contain numbers, variables, and arithmetic operations (+, –, *, and /), as well as parentheses. However, the expression need not be fully parenthesized, and when parentheses are missing, the usual Java precedence rules are used to determine the order of evaluation. Your program should allow the user to enter additional expressions until the user wishes to end the program. For a more difficult assignment, enhance your program so that the expression need not be well formed, and if it is not well formed, then the user is asked to re-enter the expression.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: