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 derivative of f(x) = 3x^2 + 7x - 4?
+
What are the characteristics of a hyperbola with equation x^2/25 - y^2/16 = 1?
+
What is the value of (3^2)^4?
+
New questions in Mathematics
Pedro bought 9 kg of sugar at the price of R$1.80 per kilogram, six packets of coffee at the price of R$3.90 per packet and 8 kg of rice at the price of R$2.70 per kilogram. Knowing that he paid for the purchases with a R$100.00 bill, how much change did he receive?
431414-1*(11111-1)-4*(5*3)
I need .23 turned into a fraction
58+861-87
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=_____
The sum of two numbers is 6, and the sum of their squares is 28. Find these numbers exactly
what is the annual rate on ​$525 at 0.046​% per day for 3 months?
7/6-(-1/9)
2/3+5/6×1/2
A company that manufactures personal hygiene items purchases machinery for $220,000 that is considered to last 7 years; it is estimated that at the end of the period it will have a salvage value of $1000. Find: to. The depreciation rate. b. The book value at the end of the sixth year.
Find 2 numbers whose sum is 47 and whose subtraction is 13
The price per night of a suite at the Baglioni Hotel in Venice is 1896 euros, VAT included. The VAT in Italy is 25%. The hotel gets a return of 10% out of the price VAT included. a) What is the amount of VAT paid by the hotel for one
Estimate the quotient for 3.24 ÷ 82
Convert 9/13 to a percent
John he’s going to the carnival with his friends. He spends $25 on an admission ticket. He buys 10 games at X dollars each and two boxes of popcorn at Y dollars each. Write an expression to show the total cost of admission game, tickets and popcorn.
P(Z<z)=0.1003
9.25=2pi r solve for r
Find the vertex F(x)=x^2-10x
Perform operations with the polynomials P(x) = x3 and Q(x) = 2x2 + x – 3x3 : a) P(x) - Q(x)
2.3 X 0.8