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 35% of 240?
+
What is the value of f(2) in the given reciprocal function f(x) = 1/x?
+
What is the measure of the third angle in a triangle if two angles have measures of 40 degrees and 85 degrees?
+
New questions in Mathematics
A pump with average discharge of 30L/second irrigate 100m wide and 100m length field area crop for 12 hours. What is an average depth of irrigation in mm unIt?
Solution to the equation y'' - y' - 6y = 0
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?
Solve: −3(−2x+23)+12=6(−4x+9)+9.
The ratio of tomatoes to red apples is 2:5. If there are 20 tomaoes in the garden, how many red apples are there?
Supposed 60% of the register voters in a country or democrat. If a sample of 793 voters is selected, what is the probability that the sample proportion of Democrats will be greater than 64% round your answer to four decimal places
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)
Log(45)
Clara usually walks briskly to the farmers' market and it takes her 22 minutes. Today she walked leisurely and it took 61/2 minutes. How much more time than usual did she take to reach the market today?
prove that if n odd integer then n^2+5 is even
Prove that it is not possible to arrange the integers 1 to 240 in a table with 15 rows and 16 columns in such a way that the sum of the numbers in each of the columns is the same.
I want you to solve this problem as a grade sixth pupil in primary school: 8 Pigs ate 6 bags of fee in 20 days. How long will it take 10 pigs to eat 15 bags of feed eating at the same rate?
Is -11/8 greater than or less than -1.37?
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 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
What is the percentage of nitrogen abundance in copper dinatrate Cu(NO3)2
The slope of the tangent line to the curve f(x)=4tan x at the point (π/4,4)
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).
Let f(x)=-1/2x+5 evaluate f(-6)
13/25+7/16