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 limit of (sin(x) + x) / (2x), as x approaches 0, using L'Hospital's Rule?
+
Question: Consider the logarithmic function f(x) = log(base 2)(x+1). Graph this function and find the x-coordinate where f(x) = 3.
+
What is the result of multiplying vector A = [3, 2, -1] by vector B = [-4, 1, 5]?
+
New questions in Mathematics
Exercise 4 - the line (AC) is perpendicular to the line (AB) - the line (EB) is perpendicular to the line (AB) - the lines (AE) and (BC) intersect at D - AC = 2.4 cm; BD = 2.5 cm: DC = 1.5 cm Determine the area of triangle ABE.
If O(3,-2) is reflected across x = 2. What are the coordinates of O
If L = (-2, -5) is reflected across y= -4 , what are the coordinates of L?
math question a bookstore announces a promotion valid for the same purchase as follows: buy a book and get 10% off the total purchase! buy two books and get 20% off your total purchase! buy three or more books and get 30% off your total purchase! Marcelo wanted to buy three books that cost 20.00 each without discount but he decided to buy two books in one day and another purchase with the third book the next day. If he had bought the three books at once he would have saved the following amount.
[(36,000,000)(0.000003)^2]divided(0.00000006)
Let I ⊂ R be a bounded and nonempty interval. Show that there are numbers a, b ∈ R with a ≤ b and I =[a,b] or I =[a,b) or I =(a,b] or I =(a,b)
Suppose 56% of politicians are lawyers if a random sample of size 873 is selected, what is the probability that the proportion of politicians who are lawyers will be less than 55% round your answer to four decimal places
To make brine, José buys 1 kg of salt and pays 12 pesos. If he buys 4 kg, they charge him 48 pesos, but for 100 pesos they sell him 9 kg. What is the constant of proportionality?
If the midpoint of point A on the x=3 line and point B on the y=-2 line is C(-2,0), what is the sum of the ordinate of point A and the abscissa of point B?
4x + 8y = 5 2x + 4y = 10
In a order to compare the means of two populations, independent random samples of 410 observations are selected from each population, with Sample 1 the results found in the table to the right. Complete parts a through e below. X1 = 5,319 S1= 143 a. Use a 95% confidence interval to estimate the difference between the population means (H - H2) Interpret the contidence interval. The contidence interval IS (Round to one decimal place as needed.) Sample 2 X2 = 5,285 S2 = 198 Aa. Use a 95% confidence interval to estimate the difference between the population means (A1 - M2) Interpret the contidence interval. The contidence interval Is (Round to one decimal place as needed.) b. Test the null hypothesis Ho versus alternative hypothesis Ha (H What is the test statistic? H2) + Give the significance level of the test, and interpret the result. Use a = 0.05. Z=
Let A, B, C and D be sets such that | A| = |C| and |B| = |D|. Prove that |A × B| = |C × D|
Buffalo Company makes and sells shampoo. Each unit requires $1.40 labor costs, material costs per unit are $0.90 and other variable costs are $0.30. It sells shampoo for $4.45 to retailers. Fixed costs are $15,000. It sold 25,000 units in the current month. What is the Break-Even point in units? What is the Break-Even point in dollars? What is the contribution margin of Buffalo Company?
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
22. Let [AB] be a chord in a circle C, and k a circle which is internally tangent to the circle C at a point P and to the chord [AB] at a point Q. Show that the line P Q passes through the midpoint of the arc AB opposite to the arc APB.
Select a variable and collect at least 50 data values. For example, you may ask the students in the college how many hours they study per week or how old they are, etc. a. Explain what your target population was. b. State how the sample was selected. c. Summarise the data by using a frequency table. d. Calculate all the descriptive measures for the data and describe the data set using the measures. e. Present the data in an appropriate way. f. Write a paragraph summarizing the data.
Sally’s sales for last Sunday were $1,278. That was an increase of 6.5% over her sales for the previous Saturday. What were her sales for the previous Saturday?
Find the distance from the point (2,-1) to the line 2x-5y+10=0
Paul invites 12 friends to his birthday. He wants to give 15 candies to everyone two. The candies are sold in packs of 25. How many should he buy? packages?
An invoice for €2,880 plus default interest of €48.40 was paid on October 28th. Interest rate 5.5%. When was the bill due?