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)
Question: Find the limit as x approaches 2 of ((x^2 - 4x + 4)/(3x^2 - 7x + 4)) + ((x - 2)/(x^2 - 4x + 4))
+
[Math Question] Solve for x: log(x + 4) - log(x - 3) = 2.5
+
What is the general equation for an ellipse and what are its key characteristics?
+
New questions in Mathematics
8x²-30x-10x²+70x=-30x+10x²-20x²
The patient is prescribed a course of 30 tablets. The tablets are prescribed “1 tablet twice a day”. How many days does a course of medication last?
How do you think the company has increased or decreased its income?
Consider numbers from 1 to 2023. We delete 3 consecutive numbers so, that the avarage of the left numbers is a whole number
(5u + 6)-(3u+2)=
A regional candy factory sells a guava roll at a price of $48, the monthly fixed costs amount to $125,000 and the variable cost for making a guava roll is $28. Determine: a) The equation of the total income from the production of guava rolls.
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.
A person borrows rm 1000 from a bank at an interest rate of 10%. After some time, he pays the bank rm 1900 as full and final settlement of the loan. Estimate the duration of his loan.
15/5+7-5
Raúl, Gilberto and Arturo are playing golf; The probabilities of winning for each one are as follows: (Raúl wins) = 20% (Gilberto wins) = 0.05% (Arturo wins) = ¾%. Perform operations and order events from least to most probable.
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
Given (3x+2)E [2;14] how much money (in soles) does Sophia have if numerically it is the greatest value of x?
I. Order to add 40.25+1.31+.45 what is the first action to do ?
3/9*4/8=
Use linear approximation to estimate the value of the sine of 31o.
-1%2F2x-4%3D18
Find the minimum value of the function y = -4 x3 + 60 x2 -252 x + 8 for values of x between x = 0 and x = 9 Enter the value of the function, not the value of x
We have two distributions: A (M = 66.7, 95% CI = [60.3, 67.1]) / B (M = 71.3 95% CI = [67.7, 74.9]). Erin maintains that B is significantly larger than A. Provide your opinion on Erin’s argument and justify your opinion.
Consider the function f(x)=1/2(x+1)^2-3. Use the preceding/following interval method to estimate the instantaneous rate of change at 𝑥 = 1.
Question 3 A square has a perimeter given by the algebraic expression 24x – 16. Write the algebraic expression that represents one of its sides.