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 radian measure of an angle in a circle if its degree measure is 45?
+
Math Question: What is the limit as x approaches infinity of sin(x)/x?
+
What is the sum of the measures of the interior angles of a heptagon?
+
New questions in Mathematics
-11+29-18
58+861-87
A brass cube with an edge of 3 cm at 40 °C increased its volume to 27.12 cm3. What is the final temperature that achieves this increase?
The data set (75, 85, 58, 72, 70, 75) is a random sample from the normal distribution No(µ, σ). Determine a 95% two-sided confidence interval for the mean µ .
(2b) to the 1/4th power. Write the expression in radical form.
prove that if n odd integer then n^2+5 is even
Let r: x - y 5 = 0. Determine a general equation of the line s parallel to the line r, which forms an isosceles triangle with area 8 with the line x = 5 and the Ox axis.
The cost of unleaded gasoline in the Bay Area once followed an unknown distribution with a mean of $4.59 and a standard deviation of $0.10. Sixteen gas stations from the Bay Area are randomly chosen. We are interested in the average cost of gasoline for the 16 gas stations. 84. Find the probability that the average price for 30 gas stations is less than $4.55. a 0.6554 b 0.3446 c 0.0142 d 0.9858 e 0
A storage maker price is $2.50 per square feet. Find the price of a custom shed 4 yards long, and 5yards wide and 8 feet tall
Estimate the quotient for 3.24 ÷ 82
(2m+3)(4m+3)=0
Calculate the difference between 407 and 27
Let X be a discrete random variable such that E(X)=3 and V(X)=5. Let 𝑌 = 2𝑋^2 − 3𝑋. Determine E(Y).
48 kg of 30% sulfuric acid in a mixture of 10% and 40% sulfuric acid arose. How many kilograms were each of the original solutions?
A person runs 175 yards per minute write a variable that represents the relationship between time and distance
0<x<2π aralığındaki f(x)=x÷2 fonksiyonunun 0 < x < 4π için grafiğini çiziniz ve 0<x<2n için Fourier seri dönüşümünü gerçekleştiriniz.
8. Measurement Jillian measured the distance around a small fish pond to be 27 yards. What would be a good estimate of the distance across the pond: 14 yards, 9 yards, or 7 yards? Explain how you decided.
the length of the fenced in area is to be 5 ft greater than the width and the total amount of fencing to be used is 89 ft find the width and length
Dano forgot his computer password. The password was four characters long. Dano remembered only three characters: 3, g, N. The last character was one of the numbers 3, 5, 7, 9. How many possible expansions are there for Dano's password?
A plant found at the bottom of a lake doubles in size every 10 days. Yeah It is known that in 300 days it has covered the entire lake, indicate how many days it will take to cover the entire lake four similar plants.