Question: Make a program in C++ that converts infix arithmetic expression to a postfix expression using Shunting Yard algorithm and Stacks. This program must read an

Make a program in C++ that converts infix arithmetic expression to a postfix expression using Shunting Yard algorithm and Stacks. This program must read an infix expression from user input, and generate the postfix expression as output. It assumes that the expressions are all correct. Please include all code in C++ programming language.

It must pass the following test cases:

CASE 1: INFIX: (A + B) * C
PASSED IF RESULT IS AB+C*
CASE 2: INFIX: A + B * C + D
PASSED IF RESULT IS ABC*+D+
CASE 3: INFIX: (A + B) * (C + D)
PASSED IF RESULT IS AB+CD+*
CASE 4: INFIX: A * B + C * D
PASSED IF RESULT IS AB*CD*+
CASE 5: INFIX: A + B + C + D
PASSED IF RESULT IS AB+C+D+
CASE 6: INFIX: 67 + ( 32 / 8 ) * 3 rt 8
PASSED IF RESULT IS: 67 32 8 / 3 8 rt * +

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!