Question: I am tasked to transform infix expressions into postfix expressions. Only prog.cpp is to be changed. I was hinted to add 5 functions to complete
I am tasked to transform infix expressions into postfix expressions. Only prog.cpp is to be changed. I was hinted to add 5 functions to complete this task in prog.cpp under '// your methods...' only. The code should not be limited to handle only these examples. Please explain in detail how you do this.
The following are examples of valid input and output files, along with examples of invalid output files:
Valid input and output:
tp-01.txt => out-01.txt
beginA = Aend=>begin A A = end tp-02.txt => out-02.txt
beginA = A;B = Cend=>begin A A = ;B C = end tp-03.txt => out-3.txt
beginB = A + C;A = B;C = A - B + C - Aend=>begin B A C + = ;A B = ;C A B - C + A - = end Invalid outputs:
ep-01.txt
begin A = Bep-02.txt
begin A = b endep-03.txt
begin A +endep-04.txt
beginA = B; endep-05.txt
A = B endAdditional information:



The goal here is to transform the infix expressions into postfix expressions. The following are all found in the out-Ox.txt files. Such as: tp-01.txt begin A = A end Another example: tp-02.txt begin A = A; B = C end out-01.txt begin A A = = end out-02.txt begin A A = ; B C = end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
