Lab - Infix Expression


Objectives


Discussion


Setup

We need to:

  1. Create a directory called infix2prefix in your cs23001 folder

  2. Create a file named infix2prefix.cpp in the infix2prefix directory

  3. Copy the data3-1.txt file from the shared folder to your infix2prefix directory


Assignment

Create a program that reads in a file with infix expressions and prints out the prefix forms.

Your program should operate properly on any valid, fully parenthesized infix expression ended by a ';'. Each token of the expression will be separated by a space (' '). Example: ( ( A + B ) * C ) ;

Your code must make use of your Stack class from Project 3 Milestone 1 and your String class from Project 2 Milestone 4. You will also need to include vector.

You cannot hard-code the file to read expressions from. You must use command line arguments to open the file to read.


Requirements

The following should be true when you are done, NAMES MUST MATCH EXACTLY:


URL: https://data-structures.cs.kent.edu/labs/Lab11
Last update: EST