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)
Math Question: Find the equation of a circle with center (2, -3) and a radius of 5.
+
Question: What is the range of the square root function √x, where x is a non-negative real number?
+
What is the vertex form equation of a parabola with a vertex at (2, -3)?
+
New questions in Mathematics
A normally distributed population has a mean of 118 with a standard deviation of 18. What score separates the lowest 72% of the distribution from the rest of the scores?
Consider numbers from 1 to 2023. We want to delete 3 consecutive, so that the avarage of the left numbers is a whole number. How do we do that
1. Suppose we have a good whose quantity supplied changed from 100 to 120 units when the price increased from $10 to $12 per unit. Compute the price elasticity of supply using the midpoint method
9b^2-6b-5
A job takes 9 workers 92 hours to finish. How many hours would it take 5 workers to complete the same job?
The actual length of an object is 1.3 m . If the blueprint uses a scale of 1 : 12 , what is the length of the line on the drawing?
how many arrangement can be made of 4 letters chosen from the 8 letters of the world ABBSOLUTE
4. Show that if n is any integer, then n^2 3n 5 is an odd integer
If the midpoint of point A on the x=3 line and point B on the y=-2 line is C(-2,0), what is the sum of the ordinate of point A and the abscissa of point B?
Pedro had 80% of the amount needed to buy a game. Of this amount, you spent 15% on a watch and therefore, you will need to add another R$640.00 to purchase this game. Is the value of the game?
3. A rock is dropped from a height of 16 ft. It is determined that its height (in feet) above ground t seconds later (for 0≤t≤3) is given by s(t)=-2t2 + 16. Find the average velocity of the rock over [0.2,0.21] time interval.
The following table shows the frequency of care for some animal species in a center specializing in veterinary dentistry. Species % Dog 52.8 Cat 19.2 Chinchilla 14.4 Marmoset 6.2 Consider that the center only serves 10 animals per week. For a given week, what is the probability that at least two are not dogs? ATTENTION: Provide the answer to exactly FOUR decimal places
A machine produces 255 bolts in 24 minutes. At the same rate, how many bolts would be produced in 40 minutes?
9.25=2pi r solve for r
Take the limit of (sin(x-4))/(tan(x^2 - 16) as x approaches 4.
Determine the Linear function whose graph passes through the points (6, -2) and has slope 3.
2x-5-x+2=5x-11
The area bounded by the curve y=ln(x) and the lines x=1 and x=4 above the x−axis is
Sarah is lining a square tray with 1 inch square tiles. the side length of the tray is 9 inches. How many tiles does Sarah need?
The domain of the function f(x)=x+7x2−144 is (−∞,), ( ,), and ( , ∞).