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 general form for the vertex of a parabola function (𝑦 = 𝑎𝑥^2)?
+
Question: What is the value of the integral ∫(x^2 + 3x - 5) dx from x = 0 to x = 4?
+
Math Question: "Factorize the expression 4x² - 9 using the difference of squares formula.
+
New questions in Mathematics
Let f(x)=||x|−6|+|15−|x|| . Then f(6)+f(15) is equal to:
find the value of the tangent if it is known that the cos@= 1 2 and the sine is negative. must perform procedures.
2x-y=5 x-y=4
If O(3,-2) is reflected across x = 2. What are the coordinates of O
3x+5y=11 2x-3y=1
Two numbers differ by 7, and the sum of their squares is 29. Find the numbers.
Equivalent expression of the sequence (3n-4)-(n-2)
Answer the following questions regarding the expression below. 0.1 (a) Write the number as a fraction.
If 0101, what is the binary representation of the 4x16 decoder output?
Let r: x - y 5 = 0. Determine a general equation of the line s parallel to the line r, which forms an isosceles triangle with area 8 with the line x = 5 and the Ox axis.
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
Use a pattern to prove that (-2)-(-3)=1
In a company dedicated to packaging beer in 750 mL containers, a normal distribution is handled in its packaging process, which registers an average of 745 mL and a standard deviation of 8 mL. Determine: a) The probability that a randomly selected container exceeds 765 mL of beer b) The probability that the beer content of a randomly selected container is between 735 and 755 mL.
Congratulations, you have saved well and are ready to begin your retirement. If you have $1,750,000.00 saved for your retirement and want it to last for 40 years, and will earn 10.8% compounded monthly: What is the amount of the monthly distribuion? 216.50 How much interest is earned in retirement?
Find the number of pounds of nails required for 17850 square feet of drywall if each thousand square feet requires 4.5 pounds of nails.
A property sold for $745,000 in a co-brokered transaction. The seller has agreed to pay a 7% commission to the listing firm. The listing firm has agreed to equally split the commission with the selling firm. If the buyer’s broker will receive 8% of the selling firm’s commission, how much commission will the buyer’s broker receive? $14,900 $3725 $$37250 $18625
Calculate NPV, IRR and PAYBACK through a cash flow for a period of five years, with discount rate of: a) 10% b) 12% c) 15% initial annual cost $41,400,000
1. The cost to transport 250 packages of cement 120 kilometers is $600. What will be the cost to transport 500 packages 300 kilometers?
How much does 7.2 moles of ammonium dichromate weigh? (NH4)2Cr2O7
An election ballot asks voters to select three city judges from a group of 12 candidates. How many ways can this be done?