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)
Find the derivative of f(x) = cos(3x) + tan(2x) - sec(x) - sin(x).
+
What is the value of √(9)
+
Question: What is the value of the sine of an angle formed by a point on the unit circle corresponding to an angle measuring π/3 radians?
+
New questions in Mathematics
Find an arc length parameterization of the curve that has the same orientation as the given curve and for which the reference point corresponds to t=0. Use an arc length s as a parameter. r(t) = 3(e^t) cos (t)i + 3(e^t)sin(t)j; 0<=t<=(3.14/2)
2(2+2x)=12
A circular park has a diameter of 150ft. A circular fence is to be placed on the edge of this park. Calculate the cost of fencing this park if the rate charged is $7 per foot. Use π = 3.14.
I need .23 turned into a fraction
The bus one way of the road which is 10km is heading with speed of 20km/h ,then the bus the other 10km is heading with speed of 60km/h. The middle speed of the road is it equal with arithmetic speed of the v1 and v2 ?
A National Solidarity Bond offers A 5 year bond offering a gross return of 15% Calculate the AER for this investment. (Give your answer to two decimal places, no need for the percent or € sign in your answer)
Find the equation of the line perpendicular to −5𝑥−3𝑦+5=0 passing through the point (0,−2)
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
Lim x → 0 (2x ^ 3 - 10x ^ 7) / 5 * x ^ 3 - 4x )=2
A company made 150,000 in the first year 145,000 in the second 140,000 in the third year successively during the first decade of this company's existence it made a total of
2x2
We plan to test whether the mean mRNA expression level differs between two strains of yeast, for each of 8,000 genes. We will measure the expression levels of each gene, in n samples of strain 1 and m samples of strain 2. We plan to compute a P-value for each gene, using an unpaired two-sample t-test for each gene (the particular type of test does not matter). a) What are the null hypotheses in these tests (in words)? [2] b) If, in fact, the two strains are identical, how many of these tests do we expect to produce a P-value exceeding 1/4? [2]
A factory produces glass for windows. The thickness X of an arbitrarily selected pane of glass is assumed to be Normally distributed with expectation μ = 4.10 and standard deviation σ = 0.04. Expectation and Standard deviation is measured in millimeters. What is the probability that an arbitrary route has a thickness less than 4.00 mm?
Evaluate ab+dc if a=56 , b=−34 , c=0.4 , and d=12 . Write in simplest form.
A membership to the gym cost $25 per person in 1995. The membership cost has increased by an average $6 per person for each year since 1995. Write a linear equation for the cost of a gym membership for one person since 1995. What is the cost of a gym membership in 2009?
56 × 12 = 672. How should you adjust this answer 672 to determine 57 × 12? a) The answer increases by 1 b) The answer increases by 57 c) The answer increases by 56 d) The answer increases by 12
the length of the fenced in area is to be 5 ft greater than the width and the total amount of fencing to be used is 89 ft find the width and length
15=5(x+3)
f(x)= 9-x^2 find (f(x+h)-f(x) )/h
Write a linear equation in the slope-intercept form. Slope of the line is -1 and goes through (8,4)