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)
Question: What is the domain of the square root function f(x) = √x, where x is a real number?
+
Question: What is the area, in square units, between the x-axis, y-axis, and the graph of the equation f(x) = x^2 - 4x + 3?
+
What is the value of an angle, given the measure of its complementary angle is 30 degrees?
+
New questions in Mathematics
The random variable Y is defined as the sum between two different integers selected at random between -4 and 2 (both included). What are the possible values of the random variable Y? What is the value of P(Y=-3)? And whether it is less than or equal to -5?
A drawer contains three pairs of white socks, five pairs of black socks and two pairs of red socks. Caden randomly selects two pairs of socks on his way to the gym. What is the probability that both pairs of socks are black?
If L (-2, -5) reflected across y = -4. What are the coordinates of L?
4x-3y=5;x+2y=4
Sean must chose a 6- digit PIN number for his online banking account.Each digit can be chosen from 0 to 9. How many different possible PIN numbers can sean chose.
The sum of two numbers is equal to 58 and the largest exceeds by at least 12. Find the two numbers
A person borrows rm 1000 from a bank at an interest rate of 10%. After some time, he pays the bank rm 1900 as full and final settlement of the loan. Estimate the duration of his loan.
What is the appropriate measurement for the weight of an African elephant?
∫ √9x + 1 dx
User One of the applications of the derivative of a function is its use in Physics, where a function that at every instant t associates the number s(t), this function s is called the clockwise function of the movement. By deriving the time function we obtain the velocity function at time t, denoted by v(t). A body has a time function that determines its position in meters at time t as S(t)=t.³√t+2.t . Present the speed of this body at time t = 8 s.
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?
(a) List the set of possible rational zeros of the polynomial function F(x) = 2x3 - 11x2 + 13x - 4. (b) Find all rational zeros of F(x). Only do part B
Give an example of a function defined in R that is continuous in all points, except in the set Z of integers.
How to convert 45 kg into grams
A loan is repaid with payments of $2226 made at the end of each month for 12 years. If interest on the loan is 5.2%, compounded semi-annually, what is the initial value of the loan? Enter to the nearest cent (two decimals). Do not use $ signs or commas.
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?
Cuboid containers (open at the top) should be examined with regard to their volume. The figure below shows a network of such containers (x ∈ Df). Determine a function ƒ (assignment rule and definition area D) that describes the volume of these containers and calculate the volume of such a container if the content of the base area is 16 dm². Show that this function f has neither a local maximum nor a global maximum
2.3 X 0.8
Mark is gluing a ribbon around the sides of a picture frame. The frame is 11 inches long and 7 includes wide. How much ribbon does Mark need?
15=5(x+3)