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
85 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 volume of a right circular cylinder with a base radius of 5 units and a height of 10 units?
+
Math question: How many pairs of congruent angles are required to prove two triangles congruent using the Angle-Angle (AA) criterion? (
+
Math question: Convert the number 0.0000358 to scientific notation.
+
New questions in Mathematics
A circular park has a diameter of 150ft. A circular fence is to be placed on the edge of this park. Calculate the cost of fencing this park if the rate charged is $7 per foot. Use π = 3.14.
Determine the equations of the recipes that pass through the following pairs of points P1 (2;-1) and p2 (4;-1)
[(36,000,000)(0.000003)^2]divided(0.00000006)
Suppose X has a Poisson distribution, with a mean of 0.4. Determine the probability that x is at most 2.
solve for x 50x+ 120 (176-x)= 17340
(24, -7) is on the terminal arm of an angle in standard position. Determine the exact values of the primary trigonometric functions.
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
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
DuocUC 2) The cost C, in pesos, for the production of x meters of a certain fabric can be calculated through the function: (x+185) C(x)=81300-6x+ 20000 a) It is known that C(90) 5.344. Interpret this result. (2 points) b) Calculate C'(x) (2 points) 3 x²+111x-0.87 20000 2000 c) Function C calculates the cost while producing a maximum of 500 meters of fabric. Determine the values of x at which the cost of production is increasing and the values of x at which the cost is decreasing. (3 points) d) If a maximum of 500 meters of fabric are produced, what is the minimum production cost? (
In an audience of 4000 people, 2 people are chosen, at random, to appear on stage. How many ways can the people be chosen?
Use a pattern to prove that (-2)-(-3)=1
2)A tourist has 15 pairs of pants in his hotel room closet. Suppose 5 are blue and the rest are black. The tourist leaves his room twice a day. He takes a pair of pants and puts them on, the tourist leaves the first pair of pants in the closet again and takes another one and puts them on. What is the probability that the two pants chosen are black?
Subjects are randomly assigned to one of three specialties for a 3-month rotation, and at the end of that rotation, they are given a test that measures moral development. The scores are listed below, where a high score represents high moral development and a low score represents low moral development. Orthopedics Pediatrics Oncology 77 63 54 84 93 97 66 97 76 44 76 65 59 45 91 40 88 68 28 74 54 M = 56.86 M = 76.57 M = 72.14 What is Nt?
The volume of a cube decreases at a rate of 10 m3/s. Find the rate at which the side of the cube changes when the side of the cube is 2 m.
Sections of steel tube having an inside diameter of 9 inches, are filled with concrete to support the main floor girder in a building. If these posts are 12 feet long and there are 18 of them, how many cubic yards of concrete are required for the job?
To get to a hotel on the hill you have to travel 6 km of uphill road and every kilometer there are 6 sharp curves. Each of the sharp curves is marked by three traffic signs. How many traffic signs are there on the stretch of road that leads to the arbergi?
When taking a test with m closed answers, a student knows the correct answer with probability p, otherwise he chooses one of the possible answers at random. What is the probability that the student knows the correct answer given that he answered the question correctly.
Find I (Intrest) using simple interest formula of 17700 @ 15% for 4 years
Identify the slope and y intercept y=11+2/3x
The length of a rectangle is five more than its width. if the perimeter is 120, find both the length and the width.