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
85 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 simplified product of 2 2/3 and 4 1/5, factored by the common factors, involving real numbers only?
+
What is the integral of ∫(5x^2 + 2x + 3) dx?
+
Find the area under the hyperbolic function f(x) = sinh(x) from -1 to 1.
+
New questions in Mathematics
Find 2 numbers that the sum of 1/3 of the first plus 1/5 of the second will be equal to 13 and that if you multiply the first by 5 and the second by 7 you get 247 as the sum of the two products with replacement solution
the value of sin 178°58'
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?
58+861-87
Consider numbers from 1 to 2023. We delete 3 consecutive numbers so, that the avarage of the left numbers is a whole number
Using the integration by parts method, calculate the integral of [x².ln(1/x)]dx: x 4 /4 x³/6 x 4 /8 x³/3 x 4 /6
What’s 20% of 125?
All the liquid contained in a barrel is distributed into 96 equal glasses up to its maximum capacity. We want to pour the same amount of liquid from another barrel identical to the previous one into glasses identical to those used, but only up to 3/4 of its capacity. How many more glasses will be needed for this?
The miles per gallon (mpg) for each of 20 medium-sized cars selected from a production line during the month of March are listed below. 23.0 21.2 23.5 23.6 20.1 24.3 25.2 26.9 24.6 22.6 26.1 23.1 25.8 24.6 24.3 24.1 24.8 22.1 22.8 24.5 (a) Find the z-scores for the largest measurement. (Round your answers to two decimal places.) z =
calculate the normal vector of line y = -0.75x + 3
I need to know what 20% or £3292.75
The price per night of a suite at the Baglioni Hotel in Venice is 1896 euros, VAT included. The VAT in Italy is 25%. The hotel gets a return of 10% out of the price VAT included. a) What is the amount of VAT paid by the hotel for one
A storage maker price is $2.50 per square feet. Find the price of a custom shed 4 yards long, and 5yards wide and 8 feet tall
Solve equations by equalization method X-8=-2y 2x+y=7
Take the limit of (sin(x-4))/(tan(x^2 - 16) as x approaches 4.
Given the word WEIRD, determine a four-letter offspring that can be formed with the letters of the word written above
Read the “Local Communities as Stakeholders: Does Amazon Really Need Tax Breaks?” example on p. 83 in Ch. 3 of Management: A Practical Introduction. In your response, discuss whether you feel that tax breaks for big companies benefit local communities. Describe ways to attract business to a region without having a negative impact on the larger community.
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
Find the orthogonal projection of a point A = (1, 2, -1) onto a line passing through the points Pi = (0, 1, 1) and P2 = (1, 2, 3).
97,210 ➗ 82 division