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
84 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 formula for finding the volume of a cube with side length "s"?
+
Math question: Find the fifth-order derivative of f(x) = (2x^3 - 4x^2 + 7x - 5)^4
+
What is the foci of an ellipse with major axis 8 and minor axis 6?
+
New questions in Mathematics
Let f(x)=||x|−6|+|15−|x|| . Then f(6)+f(15) is equal to:
Let the vectors be u=(-1,0,2) , v=(0,2,-3) , w=(2,2,3) Calculate the following expressions a)<u,w> b) &lt;2u- 5v,3w&gt;
A circle with a 12-inch diameter is folded in half and then folded in half again. What is the area of the resulting shape?
Solve: −3(−2x+23)+12=6(−4x+9)+9.
Determine all solutions to the inequality |2x + 6| − |x + 1| < 6. Write your final answer in interval notation
(-5/6)-(-5/4)
-27=-7u 5(u-3)
The physician orders 15mg of tramadol(liquid). On hand is 30mg/2mL vials. How many mL will the MA administer?
Engineers want to design seats in commercial aircraft so that they are wide enough to fit ​95% of all males.​ (Accommodating 100% of males would require very wide seats that would be much too​ expensive.) Men have hip breadths that are normally distributed with a mean of 14.4 in. and a standard deviation of 1.2 in. Find P95. That​ is, find the hip breadth for men that separates the smallest ​95% from the largest 5​%.
Use a pattern to prove that (-2)-(-3)=1
9 x² + 2x + 1 = 0
2x2
Two particles of electrical charges Q1=3.8×10-⁶C and q,=4.4×10-⁶C are separated in vacuum by a distance of 4.0.10-⁸ m. Since K=9.0.10⁹ N.m²/C², the intensity of the interaction force between them, in newtons, is?
Calculate the change in internal energy of a gas that receives 16000 J of heat at constant pressure (1.3 atm) expanding from 0.100 m3 to 0.200 m3. Question 1Answer to. 7050J b. 2125J c. None of the above d. 2828J and. 10295 J
For the numbers below, select a number at random and find the probability that: a. The number is even b. The sum of the number’s digit is even c. The number is greater than 50 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
Consider the function f(x)=1/2(x+1)^2-3. Use the preceding/following interval method to estimate the instantaneous rate of change at 𝑥 = 1.
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
Sodium 38.15 38.78 38.5 38.65 38.79 38.89 38.57 38.59 38.59 38.8 38.63 38.43 38.56 38.46 38.79 38.42 38.74 39.12 38.5 38.42 38.57 38.37 38.71 38.71 38.4 38.56 38.39 38.34 39.04 38.8 A supplier of bottled mineral water claims that his supply of water has an average sodium content of 36.6 mg/L. The boxplot below is of the sodium contents levels taken from a random sample of 30 bottles. With this data investigate the claim using SPSS to apply the appropriate test. Download the data and transfer it into SPSS. Check that your data transfer has been successful by obtaining the Std. Error of the mean for your data which should appear in SPSS output as 0.03900.. If you do not have this exact value, then you may have not transferred your data from the Excel file to SPSS correctly. Do not continue with the test until your value agrees as otherwise you may not have correct answers. Unless otherwise directed you should report all numeric values to the accuracy displayed in the SPSS output that is supplied when your data has been transferred correctly. In the following questions, all statistical tests should be carried out at the 0.05 significance level. Sample mean and median Complete the following concerning the mean and median of the data. mean =  mg/L 95% CI:  to  mg/L Based upon the 95% confidence interval, is it plausible that the average sodium content is 36.9 mg/L?      median:  mg/L The median value is      36.9 mg/L. Skewness Complete the following concerning the skewness of the data. Skewness statistic =        Std. Error =  The absolute value of the skewness statistic     less than 2 x Std. Error Therefore the data can be considered to come from a population that is      . Normality test Complete the following summary concerning the formal testing of the normality of the data. H0: The data come from a population that     normal H1: The data come from a population that     normal Application of the Shapiro-Wilk test indicated that the normality assumption     reasonable for sodium content (S-W(  )=  , p=   ). Main test Using the guidelines you have been taught that consider sample size, skewness and normality, choose and report the appropriate main test from the following ( Appropriate ONE ) You have selected that you wish to report the one-sample t-test. H0: The mean sodium content     equal to 36.9 mg/L H1: The mean sodium content     equal to 36.9 mg/L Application of the one-sample t-test indicated that the mean is      36.9 mg/L (t(  ) =  , p =   ). You have selected that you wish to report the Wilcoxon signed rank test. H0: The median sodium content     equal to 36.9 mg/L H1: The median sodium content     equal to 36.9 mg/L Application of the Wilcoxon signed rank test indicated that the median is      36.9 mg/L (z =  , N =  , p =   ).
The supply of a good registers periodic increases. With each increase in the offer, the total receipts of the bidders increase. Indicate the correct statement: a) demand is elastic b) demand is inelastic c) supply is inelastic d) supply has unit elasticity.
A gas is leaking at 3.5ft3/min in a room of 2.9m by 6.9ft by 15.7m. How long would it take (in seconds) for 22% of the room to reach the LFL, if the gas has a LFL of 2.51%?