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 slope-intercept equation of a line passing through the points (2, 5) and (-3, 9)?
+
Question: Determine the x-intercept of the logarithmic function f(x) = log(base 2)(3x) - 4.5.
+
What is 5/8 as a percent?
+
New questions in Mathematics
reduction method 2x-y=13 x+y=-1
-11+29-18
90 divided by 40
For a temperature range between 177 degrees Celsius to 213 degrees Celsius, what is the temperature range in degrees Fahrenheit.
Express the following numbers in decimal system, where the subscript indicates the base: 110101 (SUBINDEX=2)
A National Solidarity Bond offers A 5 year bond offering a gross return of 15% Calculate the AER for this investment. (Give your answer to two decimal places, no need for the percent or € sign in your answer)
According to a survey in a country 27% of adults do not own a credit card suppose a simple random sample of 800 adults is obtained . Describe the sampling distribution of P hat , the sample proportion of adults who do not own a credit card
There were no defectives in a sample of 1 light bulb does this sample provide sufficient evidence that in the warehouse with millions of light bulbs fewer than 10% are defective?
What is 28 marks out of 56 as a percentage
v Is the following statement a biconditional? If Shannon is watching a Tigers game, then it is on television.
Calculate the boiling temperature and freezing temperature at 1 atmosphere pressure of a solution formed by dissolving 123 grams of ferrous oxide in 1.890 grams of HCl.
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 points (-5,-4) and (3,6) are the ends of the diameter of the circle calculate subequation
2.380× (1+0.05) / 0.95−0.05
A company has had the following data for two consecutive years. Total, asset item 3,100,500 euros 3,300,550 euros. Net amount of business figures 4,755,250 euros /5,100 euros Average number of workers employed during the year 64/70 You can present a balance sheet in an abbreviated form
A diamond ring was reduced from $999.99 to $689.99. Find the percent reduction in the price. Round the answer to the nearest tenth of a percent, if necessary.
Write an expression using compatible numbers that can be used to estimate the quotient 629\86
Given a circle 𝑘(𝑆; 𝑟 = 4 𝑐𝑚) and a line |𝐴𝐵| = 2 𝑐𝑚. Determine and construct the set of all centers of circles that touch circle 𝑘 and have radius 𝑟 = |𝐴𝐵|
What js the greatest 4-digit even number that can be formed by 3,6,1,4?
calculate the product of 4 and 1/8