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 equation of an ellipse with major axis a=5 and minor axis b=3?
+
What's the sum of 145, 72, 89, and 38?
+
What is the unit vector in the direction of vector v(3, 4) in the xy-plane?
+
New questions in Mathematics
I want to divide R$ 2200.00 between Antônio, Beto and Cássia, so that Beto receives half from Antônio and Cássia receives a third of Beto. Under these conditions, how much more will Beto receive than Cássia?
the value of sin 178°58'
A car that starts from rest moves for 11 min, reaching a speed of 135 km/h, calculate the acceleration it had
3x+5y=11 2x-3y=1
The ratio of tomatoes to red apples is 2:5. If there are 20 tomaoes in the garden, how many red apples are there?
v Is the following statement a biconditional? If Shannon is watching a Tigers game, then it is on television.
2x+4x=
Nice's central library building is considered one of the most original in the world, as it is a mix between a sculpture and a work of habitable architecture. It was called La Tête Carrée and is made up of part of a bust that supports a cube divided into five floors. It is known that the building has a total height of approximately 30 meters. It admits that the cubic part of the sculpture is parallel to the floor and has a volume of 2744 meters3 Calculate, in meters, the height of the bust that supports the cube. Displays all the calculations you made.
89, ÷ 10
Use a pattern to prove that (-2)-(-3)=1
Find the center coordinates and radius of a circle for an equation written as: 3x2 + 3y2 - 6y = —12× + 24
Professor Vélez has withdrawn 40 monthly payments of $3,275 from her investment account. If the investment account yields 4% convertible monthly, how much did you have in your investment account one month before making the first withdrawal? (Since you started making withdrawals you have not made any deposits.)
ind the z-score for which 72% of the distribution's area lies between -z and z. -1.7417, 1.7417 -1.1538, 1.1538 -1.0803, 1.0803 -2.826, 2.826
Take the limit of (sin(x-4))/(tan(x^2 - 16) as x approaches 4.
The business college computing center wants to determine the proportion of business students who have personal computers (PC's) at home. If the proportion is greater than 35%, then the lab will modify a proposed enlargement of its facilities. Suppose a hypothesis test is conducted and the test statistic is z= 2.6. Find the P-value for this test.
If the mean of the following numbers is 17, find the c value. Produce an algebraic solution. Guess and check is unacceptable. 12, 18, 21, c, 13
calculate the product of 4 and 1/8
Solve the system of equations by the addition method. 0.01x-0.08y=-0.1 0.2x+0.6y=0.2
Suppose a car license plate consists of 2 letters and two digits of which the first cannot be zero. How many different plates can be engraved? consider only 26 letters and 10 digits draw an example of this.
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.