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 are the solutions to the quadratic equation x^2 + 4x - 5 = 0?
+
What is π/4 radians when expressed in degrees?
+
What is the limit of (x^2 - 4)/(x - 2) as x approaches 2, using L'Hospital's Rule?
+
New questions in Mathematics
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?
5(4x+3)=75
The data set (75, 85, 58, 72, 70, 75) is a random sample from the normal distribution No(µ, σ). Determine a 95% two-sided confidence interval for the mean µ .
2x-4y=-6; -4y+4y=-8
The miles per gallon (mpg) for each of 20 medium-sized cars selected from a production line during the month of March are listed below. 23.0 21.2 23.5 23.6 20.1 24.3 25.2 26.9 24.6 22.6 26.1 23.1 25.8 24.6 24.3 24.1 24.8 22.1 22.8 24.5 (a) Find the z-scores for the largest measurement. (Round your answers to two decimal places.) z =
-0.15/32.6
-3(-4x+5)=-6(7x-8)+9-10x
Substitute a=2 and b=-3 and c=-4 to evaluate 2ac/(-2b^2-a)
Solve the following equation for x in exact form and then find the value to the nearest hundredths (make sure to show your work): 5e3x – 3 = 25
Express the trigonometric form of the complex z = -1 + i.
For what values of m is point P (m, 1 - 2m) in the 2⁰ quadrant?
36 cars of the same model that were sold in a dealership, and the number of days that each one remained in the dealership yard before being sold is determined. The sample average is 9.75 days, with a sample standard deviation of 2, 39 days. Construct a 95% confidence interval for the population mean number of days that a car remains on the dealership's forecourt
Find the area of a triangle ABC when m<C = 14 degrees, a = 5.7 miles, and b = 9.3 miles.
A salesperson earns a base salary of $600 per month plus a commission of 10% of the sales she makes. You discover that on average, it takes you an hour and a half to make $100 worth of sales. How many hours will you have to work on average each month for your income to be $2000?
Find I (Intrest) using simple interest formula of 17700 @ 15% for 4 years
if y=1/w^2 yw=2-x; find dy/dx
2+2020202
Solve the following 9x - 9 - 6x = 5 + 8x - 9
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
23,456 + 3,451