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
85 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 of the line passing through the points (3, 5) and (8, 12)?
+
What is the sine of an angle of 45 degrees in the unit circle?
+
What is 45 km in miles?
+
New questions in Mathematics
A client did not advance L 10,000 for the rental of a parking area and it corresponds to 4 months, of which 2 months were consumed
The Lenovo company manufactures laptop computers, it is known that for every 60 laptops produced, 54 go on the market with the highest quality standards. If a sample of 15 laptops is taken, calculate the probability that: Exactly 2 are not of high quality
Using the integration by parts method, calculate the integral of [x².ln(1/x)]dx: x 4 /4 x³/6 x 4 /8 x³/3 x 4 /6
4x567
In a store, a person carries 14 kilos of rice and 28 kilos of flour. In what ratio are the kilos found? (Remember to simplify until you reach an irreducible fraction)
Suppose you have a sample of 100 values from a population with mean mu = 500 and standard deviation sigma = 80. Given that P(z < −1.25) = 0.10565 and P(z < 1.25) = 0.89435, the probability that the sample mean is in the interval (490, 510) is: A)78.87% B)89.44% C)10.57% D)68.27%
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
Use a pattern approach to explain why (-2)(-3)=6
30y - y . y = 144
9 x² + 2x + 1 = 0
Next%C3%B3n%2C+we+are+given+a+series+of+Tri%C3%A1angles+Right%C3%A1angles+%3Cbr%2F%3Ey+in+each+one+of+them+ are+known+2%28two%29+measurements+of+sides.+%3Cbr%2F%3Elet's+determine+all+trigonom%C3%A9tric+ratios.
A Smooth Plane is listed for $195.00. Discounts of 12% and 10% are allowed. If the customer pays cash within 30 days, an additional discount of 3% is granted. What is the cost if a carpenter takes advantage of all the discounts offered?
ind the z-score for which 72% of the distribution's area lies between -z and z. -1.7417, 1.7417 -1.1538, 1.1538 -1.0803, 1.0803 -2.826, 2.826
Find the number of pounds of nails required for 17850 square feet of drywall if each thousand square feet requires 4.5 pounds of nails.
How to convert 45 kg into grams
In a 24 hours period, the average number of boats arriving at a port is 10. Assuming that boats arrive at a random rate that is the same for all subintervals of equal length (i.e. the probability of a boat arriving during a 1 hour period the same for every 1 hour period no matter what). Calculate the probability that more than 1 boat will arrive during a 1 hour period. (P(X>1) ) Give your answers to 4 decimal places and in a range between 0 and 1
(6²-14)÷11•(-3)
did an analysis of dropout from the nursing faculty at the Universidad Veracruzana. With a poblation of 122 students, it turned out that according to the gender data, the female sex predominates with 82%, and the male sex male is found with 12%. The main factors why students drop out are, first of all, "Not "re-enrolled" at 49%, second place "Personal reasons" at 20%, third place "change of school" in 11%, "lack of documents" and "economic reasons" in 7%, change of residence and lack of social service in 3%. Of this sample, how many students dropped out for other reasons?
64-6x^2>0
Solve the system of equations by the addition method. 0.01x-0.08y=-0.1 0.2x+0.6y=0.2