Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started