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 median value of a data set if the total data points are odd and given as 3, 7, 2, 9, 4?
+
Question: "Graph the inequality 3x + 4y ≤ 12 and shade the region below the line. Is the point (2, 1) a solution? Show your work."
+
What is the maximum value of the function f(x) = 3x^2 - 10x + 2 over the interval [-2, 5]?
+
New questions in Mathematics
given cos26=k find cos13
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
Karina has a plot of 5,000 square meters in which she has decided that 60% of it will be used to plant vegetables. Of this part, 12% will be dedicated to planting lettuce. How much surface area of the plot will be used for cultivation?
A car that starts from rest moves for 11 min, reaching a speed of 135 km/h, calculate the acceleration it had
Moaz wanted to test whether the level of headache pain (on a scale of 1 – 10) changes after taking Advil. He collected data from 9 participants and calculated the difference in headache pain before and after taking Advil (summarized in the table below). Determine W observed for this test. Difference Scores -2 -4 0 +1 +3 -2 0 -3 -5 Also, What is the degrees of freedom for this test?
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?
Find the sum of the first 41 terms of the progression that begins: 32, 24, 16, …
is the x element (180,270), if tanx-3cotx=2, sinx ?
There are four times as many roses as tulips in Claire’s garden. Claire picked half of the number of roses and 140 roses were left in the garden. How many roses and tulips were in the Garden the first?
How many anagrams of the word SROMEC there that do not contain STROM, MOST, MOC or CEST as a subword? By subword is meant anything that is created by omitting some letters - for example, the word EMROSCT contains both MOC and MOST as subwords.
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
If a|-7 and a|9, then a|-63
factor the polynomial completely over the set of complex numbers b(x)=x^4-2x^3-17x^2+4x+30
How to factorise 5y^2 -7y -52
A house located within the city limits has a current market value of $325,000 according to a recent appraisal. The assessed value from the last county wide tax valuation is $272,475. The tax rate is $0.36 per hundred for the county and $0.72 per hundred for the city. What is the total annual property tax liability on the property? $2340 $3510 $1962 $2943
The area bounded by the curve y=ln(x) and the lines x=1 and x=4 above the x−axis is
Calculate NPV, IRR and PAYBACK through a cash flow for a period of five years, with discount rate of: a) 10% b) 12% c) 15% initial annual cost $41,400,000
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
x(squared) -8x=0
A plant found at the bottom of a lake doubles in size every 10 days. Yeah It is known that in 300 days it has covered the entire lake, indicate how many days it will take to cover the entire lake four similar plants.