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: Within the interval [0, 10], find the extreme value of the function f(x) = x^2 - 4x + 5.
+
What is the value of f(3) if f(x) = 2x + 1?
+
What is the mode of the following data set: 3, 5, 7, 7, 9, 9, 9?
+
New questions in Mathematics
reduction method 2x-y=13 x+y=-1
The sum of an infinite geometric series is 13,5 The sum of the same series, calculated from the third term is 1,5. Q. Calculate r if r>0.
How many percent is one second out a 24 hour?
Investing equal amounts of money into each of five business ventures Let's say you plan. 20 to choose from If there are initiatives, how many different ones among 20 initiatives? five startups can be selected?
Consider numbers from 1 to 2023. We delete 3 consecutive numbers so, that the avarage of the left numbers is a whole number
9b^2-6b-5
The miles per gallon (mpg) for each of 20 medium-sized cars selected from a production line during the month of March are listed below. 23.0 21.2 23.5 23.6 20.1 24.3 25.2 26.9 24.6 22.6 26.1 23.1 25.8 24.6 24.3 24.1 24.8 22.1 22.8 24.5 (a) Find the z-scores for the largest measurement. (Round your answers to two decimal places.) z =
Solve this mathematical problem if 3/5 of a roll of tape measures 2m. How long is the complete roll?
∫ √9x + 1 dx
89, ÷ 10
Scores are normally distributed with a mean of 25 and standard deviation of 5. Find the probability that sixteen randomly selected students have a mean score that is less than 24.
30y - y . y = 144
factor the polynomial completely over the set of complex numbers b(x)=x^4-2x^3-17x^2+4x+30
prove that for sets SS, AA, BB, and CC, where AA, BB, and CC are subsets of SS, the following equality holds: (A−B)−C=(A−C)−(B−C)
7- A printing company found in its investigations that there were an average of 6 errors in 150-page prints. Based on this information, what is the probability of there being 48 errors in a 1200-page job?
Evaluate ab+dc if a=56 , b=−34 , c=0.4 , and d=12 . Write in simplest form.
To paint a 250 m wall, a number of workers were employed. If the wall were 30 m longer, 9 more workers would be needed. How many were employed at the beginning?
calculate the product of 4 and 1/8
A rectangular swimming pool has a length of 14 feet, a width of 26 feet and a depth of 5 feet. Round answers to the nearest hundredth as needed. (a) How many cubic feet of water can the pool hold? cubic feet (b) The manufacturer suggests filling the pool to 95% capacity. How many cubic feet of water is this? cubic feet
Find the rule that connects the first number to the second number of each pair. Apply the rule to find the missing number in the third pair. (18 is to 22) (54 is to 26) (9 is to ?)