Question

A function that receives two integers and the operation to be performed and returns the result, use pseint step by step

257

likes
1287 views

Answer to a math question A function that receives two integers and the operation to be performed and returns the result, use pseint step by step

Expert avatar
Nash
4.9
87 Answers
Para resolver este problema, vamos a seguir los siguientes pasos utilizando PseInt:

Paso 1: Solicitar al usuario que ingrese dos números enteros y la operación a realizar.
Paso 2: Leer los dos números enteros y la operación.
Paso 3: Realizar la operación solicitada (suma, resta, multiplicación o división) con los dos números.
Paso 4: Devolver el resultado de la operación.
Paso 5: Fin.

Ahora vamos a escribir el pseudocódigo para este problema paso a paso:

```
Algoritmo FuncionOperacion
Definir num1, num2, resultado Como Entero
Definir operacion Como Caracter

Escribir "Ingrese el primer número: "
Leer num1

Escribir "Ingrese el segundo número: "
Leer num2

Escribir "Ingrese la operación a realizar (+, -, *, /): "
Leer operacion

Segun operacion Hacer
' Realizar la operación correspondiente
Segun op
caso "+":
resultado = num1 + num2
caso "-":
resultado = num1 - num2
caso "*":
resultado = num1 * num2
caso "/":
resultado = num1 / num2
FinSegun

Escribir "El resultado es: ", resultado
FinAlgoritmo
```

Este pseudocódigo recibe dos números enteros y la operación a realizar, luego realiza la operación deseada y muestra el resultado.

**Respuesta:** La función que reciba dos números enteros y la operación a realizar y devuelva el resultado puede implementarse en PseInt siguiendo los pasos mencionados anteriormente.

Frequently asked questions (FAQs)
Question: Calculate the square root of 144 and find the square root value from the square root table.
+
What is the value of sin(45° + 60°) + cos(-30°) - tan(150°)?
+
Math question: For a parabola function given by 𝑦 = ax^2, if the coefficient 𝑎 is negative, what impact does it have on the orientation and vertex position of the parabola?
+
New questions in Mathematics
Write 32/25 as a percent
Evaluate limx→∞tan−1(x) using that y=tan−1(x) exactly when x=tan(y) . (Hint: Both tan and tan−1 are continuous!)
The Lenovo company manufactures laptop computers, it is known that for every 60 laptops produced, 54 go on the market with the highest quality standards. If a sample of 15 laptops is taken, calculate the probability that: Exactly 2 are not of high quality
4.2x10^_6 convert to standard notation
The sum of two numbers is 6, and the sum of their squares is 28. Find these numbers exactly
Suppose X has a Poisson distribution, with a mean of 0.4. Determine the probability that x is at most 2.
Determine the momentum of a 20 kg body traveling at 20 m/s.
If you randomly selected one person from the 900 subjects in this study, what is the probability that the person exhibits the minimum BMI?
-3(-4x+5)=-6(7x-8)+9-10x
find x in the equation 2x-4=6
A box contains 18 blue balls and 33 white balls. What is the ratio of the blue to white balls?
20% of 3500
Find all real numbers x that satisfy the equation \sqrt{x^2-2}=\sqrt{3-x}
Log5 625
Which of the methods below can be used to workout 95% of an amount? a. Dividing the amount 100 and multiply by 95 b. Working out 5% of the amount and taking it away from the full amount c. Dividing 95 by 100 and multiplying the answer by the amount d. Dividing the amount by 95 and then multiply by 100
Consider mixing 150 ml, 0.1M, HCI with 100 ml, 0.2M, KOH solution. Determine the pH of final solution.
A salesperson earns a base salary of $600 per month plus a commission of 10% of the sales she makes. You discover that on average, it takes you an hour and a half to make $100 worth of sales. How many hours will you have to work on average each month for your income to be $2000?
A 20-year old hopes to retire by age 65. To help with future expenses, they invest $6 500 today at an interest rate of 6.4% compounded annually. At age 65, what is the difference between the exact accumulated value and the approximate accumulated value (using the Rule of 72)?
An export company grants a bonus of $100,000 pesos to distribute among three of its best employees, so that the first receives double the second and the latter receives triple the third. How much did each person receive?
The car with an irresponsible driver starts to brake when it goes through a red light. When passing the traffic light, he does so at a speed of 115 kph in the right lane. Further ahead, 70 meters from the traffic light, a child is crossing the street and falls. If the effect of the car's brakes is equivalent to a deceleration of magnitude 5.7m/s². Is the child hit by the car or not? How far from the traffic light does the car stop?