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 number of ways to arrange 5 students out of 10 in a row?
+
How many pairs of corresponding parts of congruent triangles can be identified given the SSS congruence rule?
+
What is the sine ratio of angle A in a right triangle, given that the opposite side is 4 and the hypotenuse is 6?
+
New questions in Mathematics
A=m/2-t isolate t
Find the measures of the sides of ∆KPL and classify each triangle by its sides k (-2,-6), p (-4,0), l (3,-1)
4X^2 25
4x-3y=5;x+2y=4
If f(x,y)=6xy^2+3y^3 find (∫3,-2) f(x,y)dx.
The equation of the straight line that passes through the coordinate point (2,5) and is parallel to the straight line with equation x 2y 9 = 0 is
find x in the equation 2x-4=6
Find all real numbers x that satisfy the equation \sqrt{x^2-2}=\sqrt{3-x}
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.
show step by step simplification: (¬𝑑∨((¬b∧c)∨(b∧¬c)))∧((𝑎 ∧ 𝑏) ∨ (¬𝑎 ∧ ¬𝑏))∧(¬𝑐∨((¬𝑑∧𝑎)∨(𝑑∧¬𝑎)))
Solve the following equation for x in exact form and then find the value to the nearest hundredths (make sure to show your work): 5e3x – 3 = 25
The function h(t)=-5t^2+20t+60 models the height in meters of a ball t seconds after it’s thrown . Which describe the intercepts and vertex of this function
Determine the increase of the function y=4x−5 when the argument changes from x1=2 to x2=3
If the regression equation is given by 4x –y + 5 = 0, then the slope of regression line of y on x is
A popular cell phone family plan provides 1500 minutes. It charges 89.99/month for the first 2 lines and 9.99 for every line after that. Unlimited text messages for all phone lines costs $30.00/month, and Internet costs $10.00/month per phone line. If a family with a $200 monthly budget buys this plan and signs up for unlimited text messaging and Internet on each phone line, how many cell phone lines can they afford? Use an inequality to solve this problem. Graph your solution on the number line and explain the meaning of your graph in a sentence.
Find the zero of the linear function 8x + 24 = 0
The mean of 4 numbers is 5 and the mean of 3 different numbers is 12. What is the mean of the 7 numbers together? Produce an algebraic solution. Guess and check is acceptable.
A rectangular swimming pool has a length of 14 feet, a width of 26 feet and a depth of 5 feet. Round answers to the nearest hundredth as needed. (a) How many cubic feet of water can the pool hold? cubic feet (b) The manufacturer suggests filling the pool to 95% capacity. How many cubic feet of water is this? cubic feet
97,210 ➗ 82 division
Find the number of liters of water needed to reduce 9 liters of lotion. shave containing 50% alcohol to a lotion containing 30% alcohol.