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 equation of an ellipse in terms of its center, major and minor axes lengths, and eccentricity?
+
Math question: "Factorize the expression 4x^3 - 12x^2 + 8x using the distributive property."
+
Math question: What is the slope-intercept equation of a line that passes through the points (2, 4) and (5, 9)?
+
New questions in Mathematics
Calculate to represent the function whose graph is a line that passes through the points (1,2) and (−3,4). What is your slope?
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?
a ferry travels 1/6 of the distance between two ports in 3/7 hour. the ferry travels at a constant rate. at this rate, what fraction of the distance between the two ports can the ferry travel in one hour?
5 squirrels were found to have an average weight of 9.3 ounces with a sample standard deviation is 1.1. Find the 95% confidence interval of the true mean weight
The gross domestic product the gdp for the United States in 2017 was approximately $2.05x10^3. If you wrote this number in standard notation , it would be 205 followed by how many zeros
Revenue Maximization: A company sells products at a price of $50 per unit. The demand function is p = 100 - q, where p is the price and q is the quantity sold. How many units should they sell to maximize revenue?
Consider the relation R defined on the set of positive integers as (x,y) ∈ R if x divides y. Choose all the true statements. R is reflexive. R is symmetric. R is antisymmetric. R is transitive. R is a partial order. R is a total order. R is an equivalence relation.
*Question!!* *Victory saved 3,000 in first bank and 2,000 Naira in union bank PSC with interest rate of X% and Y% per annual respectively his total interest in one year is #640. If she has saved 2,000 naira with first bank and 3,000 naira in union bank for same period she would have made extra 20# as additional interest, then find the value of X and Y
In a normally distributed data set a mean of 31 where 95% of the data fall between 27.4 and 34.6, what would be the standard deviation of that data set?
A job takes 9 workers 92 hours to finish. How many hours would it take 5 workers to complete the same job?
Divide 22 by 5 solve it by array and an area model
how many arrangement can be made of 4 letters chosen from the 8 letters of the world ABBSOLUTE
TEST 123123+1236ttttt
Buffalo Company makes and sells shampoo. Each unit requires $1.40 labor costs, material costs per unit are $0.90 and other variable costs are $0.30. It sells shampoo for $4.45 to retailers. Fixed costs are $15,000. It sold 25,000 units in the current month. What is the Break-Even point in units? What is the Break-Even point in dollars? What is the contribution margin of Buffalo Company?
2x2
factor the polynomial completely over the set of complex numbers b(x)=x^4-2x^3-17x^2+4x+30
To get to a hotel on the hill you have to travel 6 km of uphill road and every kilometer there are 6 sharp curves. Each of the sharp curves is marked by three traffic signs. How many traffic signs are there on the stretch of road that leads to the arbergi?
7- A printing company found in its investigations that there were an average of 6 errors in 150-page prints. Based on this information, what is the probability of there being 48 errors in a 1200-page job?
solve R the following equation 4 x squared - 35 - 9 over x squared is equal to 0
Triangle ABC has AB=AC and angle BAC =X, with X being less than 60 degrees. Point D lies on AB such that CB = CD Point E lies on AC such that CE= DE Determine angle DEC in terms of X