Question: I'm trying to create a program for the following question in C++ Write a program that takes an arithmetic expression as a string and returns

I'm trying to create a program for the following question in C++

Write a program that takes an arithmetic expression as a string and returns its value. For example, if the user enters 8*2+1+3 then the program should return 20.

(You must use a null terminated character array to represent a string)

I've successfully completed the program but I'm having some trouble with prioritizing the multiplication and division. The program is computing from left to right without priority. is there a way to add priority?

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!