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 circumference of a circle with radius 5?
+
What is the standard deviation of the data set 1, 3, 5, 7, 9, 11, 13, 15, 17, and 19?
+
What is the x-intercept of the exponential function y = 2^x + 3?
+
New questions in Mathematics
A circle with a 12-inch diameter is folded in half and then folded in half again. What is the area of the resulting shape?
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.
3x+5y=11 2x-3y=1
*Question!!* *Victory saved 3,000 in first bank and 2,000 Naira in union bank PSC with interest rate of X% and Y% per annual respectively his total interest in one year is #640. If she has saved 2,000 naira with first bank and 3,000 naira in union bank for same period she would have made extra 20# as additional interest, then find the value of X and Y
132133333-33
Suppose SAT reading scores are normally distributed with a mean of 496 and a standard deviation of 109. The University plans towards scholarships for students who scores are in the top 7%. What is the minimum score required for the scholarship round your answer to the nearest whole number.
The thermal representation f(x) = 20 times 0.8 to the power of x is known from an exponential function f. Specify the intersection point with the y-axis
During a fishing trip Alex notices that the height h of the tide (in metres) is given by h=1−(1/2)*cos(πt/6) where t is measued in hours from the start of the trip. (a) Enter the exact value of h at the start of the trip in the box below.
A stunt man jumps horizontally from a building to the roof of a garage that is 2 meters lower. How fast does he need to be to land on the roof of the said garage that is 3 meters away from the building?
A company receives sales in $20 per book and $18 per calculator. The per unit cost to manufacture each book and calculator are $5 and 4$ respectively. The monthly (30 day) cost must not exceed $27000 per month. If the manufacturing equipment used by the company takes five minutes to produce a book and 15 minutes to produce a calculator, how many books and calculators should the company produce to maximise profit? Please solve graphically and
The points (-5,-4) and (3,6) are the ends of the diameter of the circle calculate subequation
TEST 123123+123123
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!
The grading on a $159,775 house comes to $3974.75. What percent of the total cost is this? (Express your answer to the nearest hundredth percent.)
A contractor gives a bank note for $10250 at a rate of 1% for one month. How much interest is charged for 4 months?
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
Find the equation of a straight line that has slope 3 and passes through the point of (1, 7) . Write the equation of the line in general forms
-6 - t / 4 = -1
16-(x²+x+2)²
Sin(5pi/3)