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 product of 57 multiplied by 83?
+
What is the value of f(10) for the logarithmic functions f(x) = log x and f(x) = ln x? (
+
Math question: Find the measure of an angle bisector that divides a triangle into two congruent angles with measures 40° and 70°.
+
New questions in Mathematics
a runner wants to build endurance by running 9 mph for 20 min. How far will the runner travel in that time period?
P is a polynomial defined by P(x) = 4x^3 - 11×^2 - 6x + 9. Two factors are (x - 3) and (x + 1). Rewrite the expression for P as the product of linear factors.
Consider numbers from 1 to 2023. We delete 3 consecutive numbers so, that the avarage of the left numbers is a whole number
Solve the math problem 400 students are asked if they live in an apartment and have a pet: Apartment: 120 Both: 30 Pet: 90 The probability that a randomly selected student not living in an apartment has a pet is
Suppose the horses in a large stable, have a mean weight of a 807 pounds and a variance of 5776. What is the probability that the mean weight of the sample of horses with differ from the population mean by greater than 18 pounds is 41 horses are sampled at random from the stable round your answer to four decimal places.
-27=-7u 5(u-3)
You mix a powder drug with a 4.5ml of liquid to get a reconstituted solution with a concentration of 250mg/ml. The prescribers order is for 500 mg . You will give what ml of the reconstituted solution
Find all real numbers x that satisfy the equation \sqrt{x^2-2}=\sqrt{3-x}
Let A, B, C and D be sets such that | A| = |C| and |B| = |D|. Prove that |A × B| = |C × D|
The sick-leave time of employees in a firm in a month is normally with a mean of 100 hours and a standard deviation of 20 hours. Find the probability that the sick-leave time of an employee in a month exceeds 130 hours.
On+January+10+2023+the+CONSTRUCTORA+DEL+ORIENTE+SAC+company+acquires+land+to+develop+a+real estate+project%2C+which+prev%C3% A9+enable+50+lots+for+commercial+use+valued+in+S%2F+50%2C000.00+each+one%2C+the+company+has+as+a+business+model+generate+ cash+flow+through%C3%A9s+of+the+rental%2C+so+47%2C+of+the+50+enabled+lots+are+planned to lease+47%2C+and+ the+rest+will be%C3%A1n+used+by+the+company+for+management%C3%B3n+and+land+control
Let f and g be defined in R and suppose that there exists M > 0 such that |f(x) − f(p)| ≤ M|g(x) − g(p)|, for all x. Prove that if g is continuous in p, then f will also be continuous in p.
Find the zero of the linear function 8x + 24 = 0
Solve for B write your answer as a fraction or as a whole number. B-1/7=4
Calculate NPV, IRR and PAYBACK through a cash flow for a period of five years, with discount rate of: a) 10% b) 12% c) 15% initial annual cost $41,400,000
1. The cost to transport 250 packages of cement 120 kilometers is $600. What will be the cost to transport 500 packages 300 kilometers?
Convert (324)𝑓𝑖𝑣𝑒 into base-ten
Mark is gluing a ribbon around the sides of a picture frame. The frame is 11 inches long and 7 includes wide. How much ribbon does Mark need?
Let f(x)=-1/2x+5 evaluate f(-6)
A gas is leaking at 3.5ft3/min in a room of 2.9m by 6.9ft by 15.7m. How long would it take (in seconds) for 22% of the room to reach the LFL, if the gas has a LFL of 2.51%?