Question: Create a text file that will consist of expression strings, one expression string per line. Assume that the file contents are all valid infix expressions

Create a text file that will consist of expression strings, one expression string per line. Assume that the file contents are all valid infix expressions follow the rules established in this assignment.

Do not have the program check for arithmetical syntax errors that may exist in the file. Use the C++ streams capability to read the file contents into a string based stream. Your program should read a line that has a valid expression into an infix string that will display the inputted infix string, process the infix string to a postfix string using a shunting yard algorithm and display the postfix string.

The code should then go back and read another infix expression line until the whole file has been read and processed. Populate the expression file with valid expressions using the rules in this document.

You need to show that you are testing valid expressions for a variety of expressions that covers all operators, operator precedence and use parentheses. You will be graded on the expressions you create to thoroughly test your program. The program must use:

Application class named: ShuntingYardClass

Stack template class named: OperatorStackClass

Map template class named: OperatorMapClass

Use a template map class for precedence determination. Use a template stack class for the shunting yard. The program must be modular, well structured, well organized and follow the best programming practices document.

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!