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)
Math question: In circle P with a radius of 10 units, if angle AOB is 70 degrees, what is the length of arc AB?
+
What is the value of x in the quadratic equation 2x² + 5x - 3 = 0?
+
Question: Find the maximum value of the function f(x) = 5x^3 - 2x^2 + 4x - 3 on the interval [-1, 2].
+
New questions in Mathematics
10.Silvana must knit a blanket in 9 days. Knitting 8 hours a day, at the end of the fifth day, only 2/5 of the blanket was done. To be able to finish on time, how many hours will Silvana have to knit per day?
The profit G of the company CHUNCHES SA is given by G(x) = 3×(40 – ×), where × is the quantity of items sold. Find the maximum profit.
A brass cube with an edge of 3 cm at 40 °C increased its volume to 27.12 cm3. What is the final temperature that achieves this increase?
Find the root of x^4-10x^ 5=0 using Newton's method, with a precision of the smallest positive root.
Suppose 56% of politicians are lawyers if a random sample of size 873 is selected, what is the probability that the proportion of politicians who are lawyers will be less than 55% round your answer to four decimal places
Equivalent expression of the sequence (3n-4)-(n-2)
To celebrate the five-year anniversary of a consultancy specializing in information technology, the administrator decided to draw 3 different qualification courses among its 10 employees. Considering that the same employee cannot be drawn more than once, the total number of different ways of drawing among employees is:
Primes are numbers divisible only by 1 and themselves; There are infinitely many prime numbers and the first ones are 2, 3, 5, 7, 11, 13, 17, 19, 23, .... Consider a 12-sided die, with the faces numbered from 1 to 12. Out of 4 rolls, the probability that only the first three numbers are primes is:
User Before the election, a poll of 60 voters found the proportion who support the Green candidate to be 25%. Calculate the 90% confidence interval for the population parameter. (Give your answers as a PERCENTAGE rounded to TWO DECIMAL PLACES: exclude any trailing zeros and DO NOT INSERT THE % SIGN) Give the lower limit of the 90% confidence interval Give the upper limit of the 90% confidence interval
Let A, B, C and D be sets such that | A| = |C| and |B| = |D|. Prove that |A × B| = |C × D|
I. Order to add 40.25+1.31+.45 what is the first action to do ?
There are 3 orchards, a, b and c. Orchard a has 60 fewer trees than orchard b orchard c has 3 times as many trees as orchard b. If the three orchards have 430 trees altogether, how many trees does orchard c have?
On+January+10+2023+the+CONSTRUCTORA+DEL+ORIENTE+SAC+company+acquires+land+to+develop+a+real estate+project%2C+which+prev%C3% A9+enable+50+lots+for+commercial+use+valued+in+S%2F+50%2C000.00+each+one%2C+the+company+has+as+a+business+model+generate+ cash+flow+through%C3%A9s+of+the+rental%2C+so+47%2C+of+the+50+enabled+lots+are+planned to lease+47%2C+and+ the+rest+will be%C3%A1n+used+by+the+company+for+management%C3%B3n+and+land+control
When Sara was 15 years old, an uncle left her as inheritanceà a sum of 10,000 euros which he invested in a bank that applies the interest rate of 2,5% annual. Today Sara is 18 years and wants to buy a'car, how much she can ò withdraw from the bank?
Determine a general formula​ (or formulas) for the solution to the following equation.​ Then, determine the specific solutions​ (if any) on the interval [0,2π). cos30=0
We have received our p&l statement back from accounts. The board has asked for an innovation hub. What items should we prioritise reviewing to decide if we can afford an innovation hub?
17. A loan for $104259 is taken out for 10 years with an annual interest rate of 9.4%, compounded quarterly. What quarterly payment is required to pay the loan off in 10 years? Enter to the nearest cent (two decimals). Do not use $ signs or commas in the answer.
2X+2=8
Let I be an interval and let f : I → R be a continuous function such that f(I) ⊂ Q. Show (in symbols) that f is constant.
(3.1x10^3g^2)/(4.56x10^2g)