Docsity

Algoritmos de Operaciones Matemáticas Básicas - Prof. Vilca Cardenas, Ejercicios de Diseño de Algoritmos

Toggle sidebar
bg1
S06.so6-TAREA 01
1)Algoritmo
OPERACIONES_ARITMÉTICAS
definir a, b Como Real
Definir d, e, f, g Como Real
Escribir "Ingrese Nº 1"
leer a
Escribir "Ingrese Nº 2"
leer b
d=a+b
e=a-b
f=a*b
g=a/b
Escribir "La suma de los numeros es ", d
Escribir "La resta de los numeros es ", e
Escribir "La multiplicación de los numeros es ", f
Escribir "La división de los numeros es ", g
FinAlgoritmo
pf3
pf4
pf5
pf8

Vista previa parcial del texto

¡Descarga Algoritmos de Operaciones Matemáticas Básicas - Prof. Vilca Cardenas y más Ejercicios en PDF de Diseño de Algoritmos solo en Docsity!

S06.so6-TAREA 01

1)Algoritmo OPERACIONES_ARITMÉTICAS definir a, b Como Real Definir d, e, f, g Como Real Escribir "Ingrese Nº 1" leer a Escribir "Ingrese Nº 2" leer b d=a+b e=a-b f=a*b g=a/b Escribir "La suma de los numeros es ", d Escribir "La resta de los numeros es ", e Escribir "La multiplicación de los numeros es ", f Escribir "La división de los numeros es ", g FinAlgoritmo

2)Algoritmo MEDIA_PROMEDIO definir a, b, c Como Real Definir d Como Real Escribir "Ingrese Nº 1" leer a Escribir "Ingrese Nº 2" leer b Escribir "Ingrese Nº 3" leer c d=(a+b+c)/ Escribir "El promedio es ", d FinAlgoritmo 3)Algoritmo Soles_Dólares definir a Como Real Definir b Como Real Escribir "Ingrese Nº en soles" leer a b=a/3. Escribir "Dólares: ", b FinAlgoritmo 4)Algoritmo ÁREA_CIRCUNFERENCIA

6)Algoritmo TRANSFORMACIÓN_DE_SEGUNDOS definir h, m, s Como Real Definir x Como Real Escribir "Ingrese horas" leer h Escribir "Ingrese minutos" leer m Escribir "Ingrese segundos" leer s x=(h3600)+(m60)+s Escribir "Cantidad en segundos es ", x FinAlgoritmo 7)Algoritmo INTERCAMBIAR_DOS_VALORES definir N1, N2, aux Como Real Escribir "Ingrese numero 1" leer N Escribir "Ingrese numero 2" leer N aux=N N1=N N2=aux Escribir "El numero 1 despues del intercambio es ", N Escribir "El numero 2 despues del intercambio es ", N FinAlgoritmo

  1. Algoritmo A_P_D_RECTÁNGULO definir b, h, a, d, p Como Real Escribir "Ingrese base" leer b Escribir "Ingrese altura" leer h a=bh d=RAIZ(bb+hh) p=2(b+h) Escribir "El área es ", a Escribir "La diagonal es ", d Escribir "El perimetro es ", p FinAlgoritmo 9)Algoritmo SUELDO definir nom Como Caracter definir h, ph, s Como Real Escribir "Ingrese nombre" leer nom Escribir "Ingrese horas trabajadas:" leer h Escribir "El pago en horas (soles) es:" leer ph s=h*ph Escribir "El sueldo es de ", s FinAlgoritmo
  2. Algoritmo DESCUENTO definir p, d Como Real Escribir "Ingrese el precio de la prenda en soles" leer p

si d< Escribir "La ecuación no existe" sino x1=(-b-RAIZ(d))/(2a) x2=(-b+RAIZ(d))/(2a) FinSi Escribir "Primera raiz: ", x Escribir "Segunda raiz: ", x FinAlgoritmo

  1. Algoritmo ECUACIÓN_DE_SEGUNDO_GRADO Definir a1, a2, b1, b2, c1, c2 Como Real Definir determinante Como Real Definir valorX, valorY Como Real Escribir "Ingrese el valor a1 " Leer a Escribir "Ingrese el valor a2 " Leer a Escribir "Ingrese el valor b1" Leer b Escribir "Ingrese el valor b2 " Leer b Escribir "Ingrese el valor c1 " Leer c Escribir "Ingrese el valor c2 " Leer c Escribir "Ingrese el valor de determinante" determinante = (a1 * b2 - a2 * b1) Escribir determinante

Si determinante == 0 Entonces Escribir "El sistema de ecuaciones no tiene una solución única." SiNo valorX = (c1 * b2 - c2 * b1) / determinante valorY = (a1 * c2 - a2 * c1) / determinante Escribir "Los valores de x e y son:" Escribir "x = ", valorX Escribir "y = ", valorY Escribir "El sistema de ecuaciones tiene una solución única." FinSi FinAlgoritmo