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)
Math Question: What is the value of the unknown angle in a triangle when the other two angles measure 40° and 70°?
+
What is the value of sine in a right triangle with opposite side length of 5 and hypotenuse length of 13?
+
Math question: What is the median of a dataset that contains 16 elements?
+
New questions in Mathematics
A sample is chosen from a population with y = 46, and a treatment is then administered to the sample. After treatment, the sample mean is M = 47 with a sample variance of s2 = 16. Based on this information, what is the value of Cohen's d?
a runner wants to build endurance by running 9 mph for 20 min. How far will the runner travel in that time period?
5(4x+3)=75
3(2+x)-2(2x+6)=20-4x
58+861-87
Director of reservations believes that 9% of the ticketed passengers are no-shows. If the directors right what is the probability that the proportion of no-shows in a sample of 789 ticketed passengers with differ from the population proportion buy more than 3% round your answer to four decimal places.
According to a survey in a country 27% of adults do not own a credit card suppose a simple random sample of 800 adults is obtained . Describe the sampling distribution of P hat , the sample proportion of adults who do not own a credit card
In a grocery store, when you take out 3 peppers and 4 carrots, there are 26 peppers and 46 carrots left. How many peppers and carrots were there initially?
30y - y . y = 144
17. A loan for $104259 is taken out for 10 years with an annual interest rate of 9.4%, compounded quarterly. What quarterly payment is required to pay the loan off in 10 years? Enter to the nearest cent (two decimals). Do not use $ signs or commas in the answer.
Find the area of a triangle ABC when m<C = 14 degrees, a = 5.7 miles, and b = 9.3 miles.
In an economy with C= 10+0.8 Yd ; I= 20+0.1Y ; G= 100 ; X= 20 ; M=10+0.2Y ; T=-10+0.2Y and R= 10, when knew that Yd= Y-T+R. How much is the budget? A. -23.18 B. -28.13 C. -13.28 D. -32.18
Solve for B write your answer as a fraction or as a whole number. B-1/7=4
x²-7x+12=0
8. Measurement Jillian measured the distance around a small fish pond to be 27 yards. What would be a good estimate of the distance across the pond: 14 yards, 9 yards, or 7 yards? Explain how you decided.
7-1=6 6x2=12 Explain that
8(x+4) -4=4x-1
An export company grants a bonus of $100,000 pesos to distribute among three of its best employees, so that the first receives double the second and the latter receives triple the third. How much did each person receive?
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.
The domain of the function f(x)=x+7x2−144 is (−∞,), ( ,), and ( , ∞).