Question: Data Structure & Algorithm I lab Lab Project # 1 You are required to implement a program using the concepts of Stack data structure. There

Data Structure & Algorithm I lab Lab
Project #1
You are required to implement a program using the concepts of Stack data structure.
There is a file contains a set of infix expressions. At the beginning, read all expressions in this file and check if each expression is valid or not (see examples below). If the infix expression is valid, convert it to the postfix expression, then make evaluation to the postfix expression.
Your program should include an appropriate menu to the user that shows the available options.
1- Read file.
2- Print the set of infix expressions, and state if it is valid or not.
e.g.
2*5+(7/2+10)-3 valid
8-5+*2 invalid
3*(8/2 invalid
(2-5)4 invalid
3- Print the postfix expressions.
4- Evaluate the postfix expressions and print the results.
5- Write each valid infix expression with its postfix expression and result on file.
Please use the following format.
{infix expression}==>{postfix expression}==>{Result}
e.g.
{5+2*7/(6-4)}==>{527*64-/+}==>{12}
6- Exit
This project due date is 13/5/2024. late submissions will not be accepted .

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!