Question: 6 . Implement a function in C + + named MathExpression ( ) with a void return type and a single argument named msg that

6. Implement a function in C++ named MathExpression() with a void return type and a single argument named msg that represents a series of mathematical operations that need to be evaluated from left to right. Call this method and pass the value collected in Step 5 for the argument. Implement the function to provide the following functionality:
a. Calculate the result of any mathematical equation up to 100 characters in length.
b. Evaluate the equation operations from left to right.
c. Ignore any spaces entered.
d. Do not change the order of operations if parentheses are entered in the equation. All parenthesis should be ignored.
e. Provide support for the following mathematical operators +,-,*,/, and %.
f. The user should be able to specify numbers with decimal information in the equations (i.e.,5.67*6.21/3.2).
g. Convert the operands of the current operation to integers when performing the modulus operation.

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 Programming Questions!