Question: NOTES: This is a post-fix evaluation, the input is an external file named input.dat and the language to program this in is C++. Thanks You

NOTES: This is a post-fix evaluation, the input is an external file named "input.dat" and the language to program this in is C++. Thanks

You are to input an infix expression, convert it to postfix and then evaluate it. You should use a generic stack(i.e. a templated stack). Note: Ignore blank lines. Input for the assignment: "input.dat" [external file] 2 + 3 * 5 2 + 3 * 5 ^ 6 2 + 3 - 5 + 6 - 4 + 2 - 1 2 + 3 * (5 - 6) - 4 2 * 3 ^ 5 * 6 - 4 (2 + 3) * 6 ^ 2 --------------------------------------------------------- Sample output 1: 2 + 3 * 5 235*+ 17 2: 2 + 3 * 5 ^ 6 2356^*+ 46877 3: 2 + 3 - 5 + 6 - 4 + 2 - 1 23+5-6+4-2+1- 3 4: 2 + 3 * (5 - 6) - 4 2356-*+4- -5 5: 2 * 3 ^ 5 * 6 - 4 235^*6*4- 2912 6: (2 + 3) * 6 ^ 2 23+62^* 180

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!