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 equation of a parabola whose graph is in the shape of a smile, opening upwards?
+
What is the value of x in the equation log(x) = ln(x)?
+
What is the absolute value of the product of two complex numbers: (3+4i) and (-2-5i)?
+
New questions in Mathematics
Students Ana Beatriz and Paula decided to register on a website with exercises to study for upcoming simulations, but to register on this website, they need to choose a password consisting of five characters, three numbers and two letters (capital letters). or lowercase). Letters and numbers can be in any position. They know that the alphabet is made up of twenty-six letters and that an uppercase letter differs from a lowercase letter in a password. What is the total number of possible passwords for registering on this site?
a to the power of 2 minus 16 over a plus 4, what is the result?
calculate the derivative by the limit definition: f(x) = 6x^3 + 2
A normally distributed population has a mean of 118 with a standard deviation of 18. What score separates the lowest 72% of the distribution from the rest of the scores?
The derivative of a power is obtained just by subtracting 1 from the power True or false
3x+5y=11 2x-3y=1
Additionally, the boss asked Armando to determine how many toy sales branches he would have in the fifteenth year, knowing that the first year they started with two branches, by the second they already had 5 branches and, by the third year, they had 8 branches. From the above, determine the number of branches it will have for the fifteenth year.
4x567
-0.15/32.6
What is 28 marks out of 56 as a percentage
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
Find the center coordinates and radius of a circle for an equation written as: 3x2 + 3y2 - 6y = —12× + 24
MAKING AN ARGUMENT You use synthetic division to divide f(x) by (x − a) and find that the remainder equals 15. Your friend concludes that f (15) = a. Is your friend correct? Explain your reasoning.
Twenty‐five students in a class take a test for which the average grade is 75. Then a twenty‐sixth student enters the class, takes the same test, and scores 70. The test average grade calculated with 26 students will
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
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?
The blood types of individuals in society are as follows: A: 30%, B: 25%, AB: 20%, 0: 25%. It is known that the rates of contracting a certain disease according to blood groups are as follows: A: 7%, B: 6%, AB: 7%, 0: 4%. Accordingly, if a person selected by chance is known to have this disease, what is the probability of having blood group O?
Arturo had hospitalization expenses of $8,300. Your policy for medical expenses Seniors have a deductible of $500 and expenses are paid at a 20% coinsurance. These are the first expenses ever this year, how much will Arturo have to pay in your bill for hospitalization expenses?
The perimeter of a rectangular rug is 42 feet. The width is 9 feet. What is the length?
In an experiment to assess the effect of listening to audiobooks while driving, participants were asked to drive down a straight road in a driving simulator. The accompanying data on time (in milliseconds) to react when a pedestrian walked into the street for 10 drivers listening to an audiobook are consistent with summary statistics and graphs that appeared in the paper "Good Distractions: Testing the Effect of Listening to an Audiobook on Driving Performance in Simple and Complex Road Environments."† (Round your answers to four decimal places.) 1,018 1,007 1,054 988 937 1,030 1,065 1,011 860 1,106 A button hyperlink to the SALT program that reads: Use SALT. Calculate the variance for this data set. 7437.7333 Incorrect: Your answer is incorrect. Calculate the standard deviation for this data set. 86.2022 Incorrect: Your answer is incorrect.