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 relationship between the angles in an isosceles triangle?
+
What is the maximum value of the tangent function within the interval [0, π/4]?
+
Math question: What is the area of a right-angled triangle with base 6 cm and height 8 cm?
+
New questions in Mathematics
Let 𝑢 = 𝑓(𝑥, 𝑦) = (𝑒^𝑥)𝑠𝑒𝑛(3𝑦). Check if 9((𝜕^2) u / 𝜕(𝑥^2)) +((𝜕^2) 𝑢 / 𝜕(𝑦^2)) = 0
given cos26=k find cos13
Pedro bought 9 kg of sugar at the price of R$1.80 per kilogram, six packets of coffee at the price of R$3.90 per packet and 8 kg of rice at the price of R$2.70 per kilogram. Knowing that he paid for the purchases with a R$100.00 bill, how much change did he receive?
A car tire can rotate at a frequency of 3000 revolutions per minute. Given that a typical tire radius is 0.5 m, what is the centripetal acceleration of the tire?
One contestant on a game show has 1,500 points and another contestant has -250 points. What is the difference between the scores of the contestants?
Use the digits of 1,9,2,3 to come up with all the numbers 98 and 95
4x-3y=24 and 5x-2y=9 solve by elimination
-3x 2y = -6; -5x 10y = 30
Suppose the Golf ball market is perfectly competitive and the functions are known: Q = 120 – 2Px – 2Py 0.2I Q = 2Px 40 Where I = Consumers' income ($200) and Py = Price of Good Y (40) Calculate the equilibrium elasticity: a) 1.6 b) -6 c) 6 d) 0.6
Substitute a=2 and b=-3 and c=-4 to evaluate 2ac/(-2b^2-a)
3 A tree is planted when it is 1.2 m tall. Every year its growth is 3/8 of its previous year's height. Find how tall the tree will grow.
30y - y . y = 144
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"
Given the word WEIRD, determine a four-letter offspring that can be formed with the letters of the word written above
0<x<2π aralığındaki f(x)=x÷2 fonksiyonunun 0 < x < 4π için grafiğini çiziniz ve 0<x<2n için Fourier seri dönüşümünü gerçekleştiriniz.
An election ballot asks voters to select three city judges from a group of 12 candidates. How many ways can this be done?
Kayla started a book club at her school. The number of girls in the book club was one more than twice the number of boys. If there are 15 girls in the book club, how many boys are in the club?
the length of the fenced in area is to be 5 ft greater than the width and the total amount of fencing to be used is 89 ft find the width and length
A plant found at the bottom of a lake doubles in size every 10 days. Yeah It is known that in 300 days it has covered the entire lake, indicate how many days it will take to cover the entire lake four similar plants.
Find the number of liters of water needed to reduce 9 liters of lotion. shave containing 50% alcohol to a lotion containing 30% alcohol.