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)
Find the length of a side opposite a angle measuring 45° and adjacent to a side of length 5, using the Sine Law.
+
Math Question: Determine the square root of 225, 400, and 576.
+
Math question: Find the value of arccos(cos(π/6)) + arcsin(sin(7π/4)).
+
New questions in Mathematics
1 + 1
A college believes that 22% of applicants to that school have parents who have remarried. How large a sample is needed to estimate the true proportion of students who have parents who have remarried to within 5 percentage points?
a) A tap can supply eight gallons of gasoline daily to each of its 250 customers for 60 days. By how many gallons should each customer's daily supply be reduced so that it can supply 50 more customers for twenty more days?
a bank finds that the balances in its savings accounts are normally distributed with a mean of $500 and a standard deviation off of $40. What is the probability that a randomly selected account has a balance of more than $400?
A consulting company charges a fee of $50 per hour for consulting. If their monthly fixed costs are $1,000 and they want to make a monthly profit of $2,500, how many consulting hours should they bill per month?
(6.2x10^3)(3x10^-6)
x/20*100
7273736363-8
A force of 750 pounds compresses a spring 3 inches from its natural length, which is 15 inches. What will be the work done to compress it 3 inches more?
Substitute a=2 and b=-3 and c=-4 to evaluate 2ac/(-2b^2-a)
1. A pediatric client is prescribed digoxin for congestive heart failure. The dose prescribed is 40 mcg/kg twice daily. The child weighs 33 pounds. What is the dosage in mg to be given per dose? Round to the nearest hundredth. Calculate your answer in mg per dose. Enter numerical value only.____mg
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)
How do you convert a fraction to a decimal
answer this math question The scale on a map is drawn so that 5.5 inches corresponds to an actual distance of 225 miles. If two cities are 12.75 inches apart on the map, how many miles apart are they? (Round to the nearest tenth) miles apart. The two cities are how many miles apart
Find the orthogonal projection of a point A = (1, 2, -1) onto a line passing through the points Pi = (0, 1, 1) and P2 = (1, 2, 3).
8(x+4) -4=4x-1
Two trains leave stations 294 miles apart at the same time and travel toward each other. One train travels at 95 miles per hour while the other travels at 115 miles per hourHow long will it take for the two trains to meet?
If the area of a circle is 75.7ft2, what is the radius? Give the answer in metres. Round answer to 2 decimal places and enter the units.
x(squared) -8x=0
The domain of the function f(x)=x+7x2−144 is (−∞,), ( ,), and ( , ∞).