Question: C++ Evaluate expression using stacks Write a program to demonstrate the use of STACKS. The scenario is as follows: Write a program that reads a

C++ Evaluate expression using stacks

Write a program to demonstrate the use of STACKS. The scenario is as follows:

Write a program that reads a file located in c:\temp. So your file must have come similar to this:

ifstream x("c:\\temp\\input.txt");

From the file, read one expression. The expression has the following operations:

+

-

*

/

The expression also uses ( and ) to determine which gets executed first. for example, the order of operations PEMDAS and an example could be... 5*6 (5+2)/2

Note that you need to use YOUR OWN stack class. Not since will be covered in the next few weeks

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!