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)
What is the value of x in log(base 3) x = 4?
+
What is the radian measure of an angle formed by a central angle with an arc length equal to half the circumference of a circle?
+
What is the value of angle Y in triangle XYZ if the measures of angle X and angle Z are 45° and 90°, respectively?
+
New questions in Mathematics
How much volume of water in MegaLiters (ML) is required to irrigate 30 Hectare crop area with depth of 20mm?
Determine all solutions to the inequality |2x + 6| − |x + 1| < 6. Write your final answer in interval notation
I need .23 turned into a fraction
Determine the equations of the recipes that pass through the following pairs of points P1 (2;-1) and p2 (4;-1)
(2x+5)^3+(x-3)(x+3)
A person borrows rm 1000 from a bank at an interest rate of 10%. After some time, he pays the bank rm 1900 as full and final settlement of the loan. Estimate the duration of his loan.
In the telephone exchange of a certain university, calls come in at a rate of 5 every 2 minutes. Assuming a Poisson distribution, the average number of calls per second is: a) 1/8 b) 1/12 c) 1/10 d) 2/5 e) 1/24
A triangular window has a base of 6 ft. and a height of 7 ft. What is its area?
The market for economics textbooks is represented by the following supply and demand equations: P = 5 + 2Qs P = 20 - Qd Where P is the price in £s and Qs and Qd are the quantities supplied and demanded in thousands. What is the equilibrium price?
19) If the temperature of -8°C decreases by 12°C, how much will it be? a)-20°C -4°C c) 4°C d) 20°C
The simple average of 15 , 30 , 40 , and 45 is
The question is using rule 72 determine Kari wants to save 10,000 for a down payment on a house. Illustrate the difference in years it will take her to double her current 5,000 savings based on 6%, 12% and 18% interest rate .
-1%2F2x-4%3D18
Calculate the difference between 407 and 27
Twenty‐five students in a class take a test for which the average grade is 75. Then a twenty‐sixth student enters the class, takes the same test, and scores 70. The test average grade calculated with 26 students will
Kaya deposits 25,000 into an account that earns 3% interest compounded monthly. How much does Kaya have in the account after 6 years 8 months? Round to the nearest cent. 32,912.50 30,000 29,923.71 30,527.45
Translate to an equation and solve. Let x be the unknown number: What number is 52% of 81.
For how long does the principal amount of €7,537 bring the same interest as the principal amount of €12,345 invested for 8 months? Interest calculation is simple and decursive.
How many digits are there in Hindu-Arabic form of numeral 26 × 1011
Slope (7,3) and (9,5)