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
86 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)
Can you find the maximum value of the function f(x) = x^3 - 6x^2 + 9x - 1 on the interval [0, 5]?
+
Math question: What is the minimum value of the function f(x) = x^2 - 3x + 2 on the interval [-1, 4]?
+
What is the scalar product of vectors u = (2, 3) and v = (4, 5)?
+
New questions in Mathematics
The director of a company must transfer 6 people from the human resources department to the sales department, in order to sustain sales during the month of December. What is the probability that he will transfer only 2 of them?
2x-4y=-6; -4y+4y=-8
A soft drink machine outputs a mean of 23 ounces per cup. The machines output is normally distributed with a standard deviation of 3 ounces. What is the probability of filling a cup between 26 and 28 ounces round your answer to four decimal places
A job takes 9 workers 92 hours to finish. How many hours would it take 5 workers to complete the same job?
A test has 5 multiple choice questions. Each question has 4 alternatives, only one of which is correct. A student who did not study for the test randomly chooses one alternative for each question.(a) What is the probability of him getting a zero on the test?(b) What is the probability of him getting a three or more? The maximum mark for the test is 5, with each question worth one point.
In the telephone exchange of a certain university, calls come in at a rate of 5 every 2 minutes. Assuming a Poisson distribution, the average number of calls per second is: a) 1/8 b) 1/12 c) 1/10 d) 2/5 e) 1/24
Use linear approximation to estimate the value of the sine of 31o.
X³-27
Quadratic equation 2X = 15/X + 7
A contractor gives a bank note for $10250 at a rate of 1% for one month. How much interest is charged for 4 months?
factor the polynomial completely over the set of complex numbers b(x)=x^4-2x^3-17x^2+4x+30
Let N be the total number of ways to choose at least one ride, out of a total of 7 different ones, existing in an amusement park. Can it be said that N is a natural number equal to?
a) Statistics scores are normally distributed with the mean of 75 and standard deviation of 7. What is the probability that a student scores between 80 and 88
Oi👋🏻 Toque em "Criar Nova Tarefa" para enviar seu problema de matemática. Um dos nossos especialistas começará a trabalhar nisso imediatamente!
x²-7x+12=0
The following incoming payments show up at a tax inspection: 25 000€ on 19.01.2008, 140 000€ on 27.03.2008 and 19 000€ on a date that which is illegible, and 60 000€ on 15.06.2008. On which date did the payment of the 19 000€ appear, if on 30.06.2008 the money on the account (incl. interest at 4%) is 246 088.89€? Use simple interest and 30E/360 DCC. Solution: 45 days, 15.05.08
7-1=6 6x2=12 Explain that
A triangle is cut by a line s parallel to the base in such a way that it divides the side of the triangle into parts in the ratio of 2 : 3. Find the other side of the triangle if it is known that the line s divides it into parts whose length is 5 cm.
Mark is gluing a ribbon around the sides of a picture frame. The frame is 11 inches long and 7 includes wide. How much ribbon does Mark need?
13/25+7/16