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 probability of rolling a number greater than 3 on a standard six-sided die?
+
Question: Find the extreme values of the function f(x) = 3x^2 - 4x + 5 over the interval [-2, 4].
+
What is the limit as x approaches infinity of (5x^3 + 2x^2 - 3x + 1) / (2x^3 - 3x + 1)?
+
New questions in Mathematics
5(4x+3)=75
How many kilometers does a person travel in 45 minutes if they move at a rate of 8.3 m/s?
Express the following numbers in decimal system, where the subscript indicates the base: 110101 (SUBINDEX=2)
Reparameterize the curve r(t)= cos(t)i without (t)j (t)k by the arc length.
5.- From the probabilities: 𝐏(𝐁) = 𝟑𝟎% 𝐏(𝐀 ∩ 𝐁) = 𝟐𝟎% 𝐏(𝐀 ̅) = 𝟕𝟎% You are asked to calculate: 𝐏(𝐀 ∪ 𝐁)
v Is the following statement a biconditional? If Shannon is watching a Tigers game, then it is on television.
sin 30
A warehouse employs 23 workers on first​ shift, 19 workers on second​ shift, and 12 workers on third shift. Eight workers are chosen at random to be interviewed about the work environment. Find the probability of choosing exactly five first ​-shift workers.
Exercise 1 An ejidal association wishes to determine the distribution for the three different crops that it can plant for the next season on its available 900 hectares. Information on the total available and how many resources are required for each hectare of cultivation is shown in the following tables: Total available resource Water 15,000 m3 Fertilizer 5,000 kg Labor 125 day laborers Requirements per cultivated hectare Corn Soybeans Wheat Water 15 25 20 Fertilizer 5 8 7 Labor** 1/8 1/5 1/4 *The data in fraction means that with one day laborer it will be possible to care for 8, 5 and 4 hectares respectively. * Sales of crops 1 and 3, according to information from the Department of Agriculture, are guaranteed and exceed the capacity of the cooperative. However, soybeans must be limited to a maximum of 150 hectares. On the other hand, the profits for each hectare of crop obtained are estimated at: $7,500 for corn, $8,500 for soybeans and $8,000 for wheat. The objectives are to determine: • How many hectares of each crop must be allocated so that the profit is maximum. R= • The estimated profits for the ejidal cooperative in the next growing season. R=
The function h(t)=-5t^2+20t+60 models the height in meters of a ball t seconds after it’s thrown . Which describe the intercepts and vertex of this function
9.25=2pi r solve for r
How to factorise 5y^2 -7y -52
A person runs 175 yards per minute write a variable that represents the relationship between time and distance
(6²-14)÷11•(-3)
If the mean of the following numbers is 17, find the c value. Produce an algebraic solution. Guess and check is unacceptable. 12, 18, 21, c, 13
A nondegenerate ideal gas of diatomic molecules with a kilomolar mass of 2 kg/kmol and a characteristic rotational temperature of 86 K is adsorbed on the walls of a container, where the binding energy is 0.02 eV. The adsorbed molecules move freely on the walls, and their rotation is confined to the plane of the walls. Calculate the surface density of adsorbed molecules at 12 K if the gas pressure is 103 Pa! What result would you get at 68 K and the same pressure?
How many digits are there in Hindu-Arabic form of numeral 26 × 1011
Carmen's age was twice as old as Luis was when Carmen was Luis's age. When Luis is Carmen's age, their ages will add up to 112.
Hola👋🏻 Toca en "Crear Nueva Tarea" para enviar tu problema de matemáticas. ¡Uno de nuestros expertos comenzará a trabajar en ello de inmediato!
23,456 + 3,451