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 integral of f(x) = 3x^2 + 4x - 2 with respect to x?
+
What is the limit as x approaches 1 of (sin(x) - x)/((x^3) - 1)?
+
What is the measure of angle C in a triangle ABC, given that angle A measures 40 degrees and angle B measures 70 degrees?
+
New questions in Mathematics
A normal random variable x has a mean of 50 and a standard deviation of 10. Would it be unusual to see the value x = 0? Explain your answer.
Solution to the equation y'' - y' - 6y = 0
-11+29-18
what is 3% of 105?
3(4x-1)-2(x+3)=7(x-1)+2
What will be the density of a fluid whose volume is 130 cubic meters contains 16 technical units of mass? If required Consider g=10 m/s2
9b^2-6b-5
Emma is on a 50 m high bridge and sees two boats anchored below. From her position, boat A has a bearing of 230° and boat B has a bearing of 120°. Emma estimates the angles of depression to be about 38° for boat A and 35° for boat B. How far apart are the boats to the nearest meter?
determine the polynomial F of degree 2 that interpolates. f at points (0;1) (2;5) (4;6). calculate F(0.8). Note: Using the polynomial expression with difference operator.
The ninth term of a given geometric progression, with reason q , is 1792, and its fourth term is 56. Thus, calculate the fourth term of another geometric progression, whose ratio is q +1 and whose first term is equal to the first term of the first P.G. described.
The two sides of the triangle are 12 cm and 5 cm, and the angle between the sides is 60°. Cover the area of ​​the triangle!
Find the zero of the linear function 8x + 24 = 0
A natural gas company has a fixed rate of 1,320 pesos plus 1,590 pesos per cubic meter of gas consumed monthly per customer. Indicate the cost function to determine the value in pesos of the cubic meters of gas consumed in a month per customer. How much did a customer who consumed 18 cubic meters of gas pay? If a customer paid 34,710 pesos, how many cubic meters of gas did he consume?
Find the area of a triangle ABC when m<C = 14 degrees, a = 5.7 miles, and b = 9.3 miles.
Solve for B write your answer as a fraction or as a whole number. B-1/7=4
2+2020202
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?
Find the orthogonal projection of a point A = (1, 2, -1) onto a line passing through the points Pi = (0, 1, 1) and P2 = (1, 2, 3).
x(squared) -8x=0
To apply a diagnostic test, in how many ways can 14 students be chosen out of 25? if the order does not matter