Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions

Question

What are Mr. Davies ethical obligations in this situation? (D10)

Answered: 1 week ago

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago