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
66 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 measure of an angle bisected by a straight line that divides the angle into two equal parts?
+
What is the length of side b if angle A is 45°, side a is 10, and the angle opposite side b is 60°?
+
What is the condition for two triangles to be congruent, in terms of their corresponding sides and angles?
+
New questions in Mathematics
How much volume of water in MegaLiters (ML) is required to irrigate 30 Hectare crop area with depth of 20mm?
I) Find the directional derivative of 𝑓(𝑥, 𝑦) = 𝑥 sin 𝑦 at (1,0) in the direction of the unit vector that make an angle of 𝜋/4 with positive 𝑥-axis.
By differentiating the function f(x)=(x³−6x)⁷ we will obtain
3x+5y=11 2x-3y=1
A, B, C and D are numbers; If ABCD = 23, What is the result of ABCD BCDA CDAB DABC operation?
7273736363-8
Determine the momentum of a 20 kg body traveling at 20 m/s.
Supposed 60% of the register voters in a country or democrat. If a sample of 793 voters is selected, what is the probability that the sample proportion of Democrats will be greater than 64% round your answer to four decimal places
The expected market return is 13,86% and the risk free rate 1%. What would then be the risk premium on the common stocks of a company which beta is 1,55? (in %, 2 decimal places)
2x2 and how much?
-3(-4x+5)=-6(7x-8)+9-10x
TEST 123123+1236ttttt
Write the detailed definition of a supply chain/logistics related maximization problem with 8 variables and 6 constraints. Each constraint should have at least 6 variables. Each constraint should have At least 5 variables will have a value greater than zero in the resulting solution. Variables may have decimal values. Type of equations is less than equal. Numbers and types of variables and constraints are important and strict. Model the problem and verify that is feasible, bounded and have at least 5 variables are nonzero.
1. A jeweler has two gold bars, with 80% purity and the other with 95% purity. How much of each must be melted to obtain a 5 kilo ingot with 86% purity?
Salut👋🏻 Appuie sur "Créer une nouvelle tâche" pour envoyer ton problème de mathématiques. Un de nos experts commencera à travailler dessus immédiatement !
Consider a sample space S, and two events A and B such that P(A ∩ B) = 0.2, P(A ∪ B) = 0.6, P(B ∪ ̄A) = 0.8 (a) [0.5 points] Calculate P (A). (b) [0.5 points] Calculation P (B)
t+72/t=-17
f(r) = 1/r+9 find f(x^2) + 1
In an experiment to assess the effect of listening to audiobooks while driving, participants were asked to drive down a straight road in a driving simulator. The accompanying data on time (in milliseconds) to react when a pedestrian walked into the street for 10 drivers listening to an audiobook are consistent with summary statistics and graphs that appeared in the paper "Good Distractions: Testing the Effect of Listening to an Audiobook on Driving Performance in Simple and Complex Road Environments."† (Round your answers to four decimal places.) 1,018 1,007 1,054 988 937 1,030 1,065 1,011 860 1,106 A button hyperlink to the SALT program that reads: Use SALT. Calculate the variance for this data set. 7437.7333 Incorrect: Your answer is incorrect. Calculate the standard deviation for this data set. 86.2022 Incorrect: Your answer is incorrect.
Suppose a car license plate consists of 2 letters and two digits of which the first cannot be zero. How many different plates can be engraved? consider only 26 letters and 10 digits draw an example of this.