Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ I've successfully created a program that takes a mathematical expression as a string and returns the answer (I used a null terminated character array

C++

I've successfully created a program that takes a mathematical expression as a string and returns the answer (I used a null terminated character array to represent a string). For example if I enter 8*2+4 the result is 20. However I'm having some trouble sorting the mathematical operator priorities. For example, if I enter 5+3*2 then the result would be 16 instead of 11. How can I give priority to multiplication and division?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

How would you describe Mark Zuckerberg as a team leader?

Answered: 1 week ago