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 solution set for the inequality system: y > -2x + 3 and y ≤ x + 5. Graph it.
+
What is the value of 2 raised to the power of 5, divided by the square root of 9, multiplied by 4 squared?
+
What is the fully factored form of 6x² + 8x - 24 using the distributive property?
+
New questions in Mathematics
Solution of the equation y'' - y' -6y = 0
The sum of an infinite geometric series is 13,5 The sum of the same series, calculated from the third term is 1,5. Q. Calculate r if r>0.
Suppose X has a Poisson distribution, with a mean of 0.4. Determine the probability that x is at most 2.
Suppose 56% of politicians are lawyers if a random sample of size 564 is selected, what is the probability that the proportion of politicians who are lawyers will differ from the total politicians proportions buy more than 4% round your answer to four decimal places
-0.15/32.6
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)
The durability of a tire of a certain brand is a Normal random variable with an average of 64,000 km and a standard deviation of 9,000 km. Assuming independence between tires, what is the probability that the 4 tires on a car will last more than 58,000 km?
Three machines called A, B and C, produce 43%, 26% and 31% of the total production of a company, respectively. Furthermore, it has been detected that 8%, 2% and 1.6% of the product manufactured by these machines is defective. a) What is the probability that a product is not defective? b) A product is selected at random and found to be defective, what is the probability that it was manufactured on machine B?
1. A capital of $3,831 was lent, and it has produced interest of $840 from 05-12-2022 to 1-12-2023. At what annual simple interest rate was the capital lent?
Calculate the difference between 407 and 27
A,B,C and D are the corners of a rectangular building. Find the lengths the diagonals if AB measures 38' - 9" and AD measures 56' - 3"
a survey showed that 3 out of 7 voters would vote in an election. based on this survey, how many people would vote in a city with 25,000 people?
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
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.
a) Statistics scores are normally distributed with the mean of 75 and standard deviation of 7. What is the probability that a student scores between 80 and 88
The blood types of individuals in society are as follows: A: 30%, B: 25%, AB: 20%, 0: 25%. It is known that the rates of contracting a certain disease according to blood groups are as follows: A: 7%, B: 6%, AB: 7%, 0: 4%. Accordingly, if a person selected by chance is known to have this disease, what is the probability of having blood group O?
2.3 X 0.8
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?
12[4 + (8 + 7) + 5]
23,456 + 3,451