Utilize the MyStack and MyQueue classes to convert infix expressions involve single digit integer number, +, -, *, /, %, and together with ( ) into postfix expressions then evaluate the postfix expressions.

computer science

Description

Specifications: 

1. Create a Project3 class under the project package. 

2. In the Project3 class you will create a static void test() method. In this test method you will do the following: 

a. Utilize the MyStack and MyQueue classes to convert infix expressions involve single digit integer number, +, -, *, /, %, and together with ( ) into postfix expressions then evaluate the postfix expressions. 

b. The infix expressions are located in a file named “COSC602_P3_Input.txt”. Each line contains an infix expression (whitespaces and empty lines should be ignored.). 

c. The corresponding postfix expressions and results should be written into a file named “COSC602_P3_Output_.txt”. 

d. Sample input and output files are provided. 

e. The sample input file is by no mean listing all testing cases. You have to add testing cases to the input file to test your program completely. 

f. The input and output files should be located in the folder where your project folder is located (i.e. these io files and your project folder are sitting next to each other). When you open files for read and write you cannot use an absolute file path but have to use a relative file path. After you finished your program make a copy of your program folder and try to run it on another computer to see whether it still works. 

g. You will not submit any input or output files. Your program will be tested with another input file given the same format. 

3. Under the main package, in the Main class, remove the contents of the main method we have added in the last assignment and do the following: 


Related Questions in computer science category