How can I solve a mathematical expression following the hierarchy of operations? Resolver siguiendo la jerarquĆ­a de operaciones. | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

How can I solve a mathematical expression following the hierarchy of operations? Resolver siguiendo la jerarquĆ­a de operaciones.

Tengo que realizar una calculadora y esta debe de resolver la expresiĆ³n matemĆ”tica que se le ingrese, la debe de resolver siguiendo la jerarquĆ­a de operaciones, es decir: Primero resolver lo que hay dentro de parĆ©ntesis. Luego las potencias Luego la multiplicaciĆ³n y divisiĆ³n Por Ćŗltimo las sumas y restas ĀæCĆ³mo hago para que lea de estĆ” manera la expresiĆ³n matemĆ”tica y la resuelva? Por ejemplo en Python existe la funciĆ³n eval() que resuelve correctamente este tipo de expresiones. En C++ existe alguna funciĆ³n como eval()??? I have to make a calculator and it must solve the mathematical expression that is entered, it must solve it following the hierarchy of operations, that is: First solve what is inside the parentheses. Then the powers Then the multiplication and division Finally the addition and subtraction How can I get the mathematical expression to read in this way and solve it? InPython there is the function eval () that correctly solves this type of expressions.In C ++ is there some function like eval()?

14th Apr 2020, 9:51 PM
Hugo RaĆŗl LĆ³pez EnrĆ­quez
1 Resposta