Question: Write a program that converts an infix expression into an equivalent postfix expression using Algorithm discussed in class. In this program, you will consider the

Write a program that converts an infix expression into an equivalent postfix expression using Algorithm discussed in class. In this program, you will consider the following (binary) arithmetic operators: +, -, *, and /. You may assume that the expressions you will process are error free. Design a class that stores the infix and postfix strings. The class must include the following operations:

1. getInfixStores the infix expression

2. showInfixOutputs the infix expression

3. showPostfixOutputs the postfix expression Test your program on the following five expressions:

a) A + B - C;

b) (A + B ) * C;

c) (A + B) * (C - D);

d) A + ((B + C) * (E - F) - G) / (H - I);

e) A + B * (C + D ) - E / F * G + H;

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!