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)
What is the limit of (x^2 + x)/(sin(x) - x) as x approaches 0?
+
Question: Find the value of f(5) for the linear function f(x) = x.
+
What is the speed in meters per second if the distance covered is 1000 meters and the time taken is 20 seconds?
+
New questions in Mathematics
Find two natural numbers whose sum is 230 and their difference is 10. Set up the system and solve it.
3(4×-1)-2(×+3)=7(×-1)+2
The graph of the equation x²= 4py is a parabola with focus F(_,_) and directrix y=_____ Therefore, the graph of x²=12y is a parabola with focus F(_,_) and a directrix y=_____
4X^2 25
Divide 22 by 5 solve it by array and an area model
A National Solidarity Bond offers A 5 year bond offering a gross return of 15% Calculate the AER for this investment. (Give your answer to two decimal places, no need for the percent or € sign in your answer)
Find the sum of the first 41 terms of the progression that begins: 32, 24, 16, …
calculate the area in square units of A rectangle with length 6cm and breadth 5cm
6-35 A recent study by an environmental watchdog determined that the amount of contaminants in Minnesota lakes (in parts per million) it has a normal distribution with a mean of 64 ppm and variance of 17.6. Assume that 35 lakes are randomly selected and sampled. Find the probability that the sample average of the amount of contaminants is a) Greater than 72 ppm. b) Between 64 and 72 ppm. c) Exactly 64 ppm. d) Greater than 94 ppm.
Solve the equation: sin(2x) = 0.35 Where 0° ≤ x ≤ 360°. Give your answers to 1 d.p.
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
Jasminder has made 55% of the recipes in a particular cookbook. If there are 9 recipes that he has never made, how many recipes does the cookbook contain?
cube root of 56
5x+13+7x-10=99
What is the value of f(-3) for the function X squared+5x-8=
In an economy with C= 10+0.8 Yd ; I= 20+0.1Y ; G= 100 ; X= 20 ; M=10+0.2Y ; T=-10+0.2Y and R= 10, when knew that Yd= Y-T+R. How much is the budget? A. -23.18 B. -28.13 C. -13.28 D. -32.18
What is the total amount due and the amount of interest on a 3-year loan of $1,000 at a simple interest rate of 12% per year?
2.3 X 0.8
Identify the slope and y intercept y=11+2/3x
97,210 ➗ 82 division