Algoritmos Unipoli
Problema 1
Desarrolle el algoritmo y el diagrama que permita convertir calificaciones numéricas, según lo siguiente:A = 19 y 20, B =16, 17 y 18, C = 13, 14 y 15, D = 10, 11 y 12, E = 1 hasta el 9. Se asume que la nota está comprendida entre 1 y 20.
Algoritmo #1:Calificaciones
Salidas
Entradas
Constante
Procesos
Cuando Cal >=19 y =16 y =13 y =10 y =1 y =19 y =16 y =12 y =10 y =1 y =19 y =16 y =13 y =10 y =0 && =11 && =15 && =19 && =26 && 65 entonces // inicio de la 5ta condición 5.6.1 Escribir “Anciano” Si No No hacer Nada )Fin.Si )Fin.si )Fin.Si )Fin.Si )Fin.Si )Fin.Si 6. FIN
UNIPOLI
Andrés Ortiz
Página 6
Diagrama de Flujo #2:Edades
INICIO
E : Entera :Trabajo=0
„‟Ingrese Edad‟‟
Edad
No E >=0 && =11 && =15 && =19 && =26 && 65
Si
Si
Si
Si
Si
Si
„‟Niño‟‟
„‟Puber‟‟
„‟Tiene una C = a‟‟, „‟Adolescente‟‟ Res
„‟Tiene una D = a‟‟, „‟Joven‟‟ Res
„‟Tiene una D = a‟‟, „‟Adulto‟‟ Res
„‟Tiene una E = a‟‟, „‟Anciano‟‟ Res
Fin
UNIPOLI
Andrés Ortiz
Página 7
Diagrama de FlujoN-S #2: Edad
UNIPOLI
Andrés Ortiz
Página 8
Problema 3
Hacer un algoritmo y diagrama que registre 15 números en un array de 1D y muestre posiciones que ocupan posiciones impares
Algoritmo #3: Array
Salidas
Entradas N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N11, N12, N13, N14, N15
Constante
Procesos
Escribir “N1,N3, N5, N7,N9, N11, N13, N15”
“N1,N3, N5, N7,N9, N11,N13, N15”
UNIPOLI
Andrés Ortiz
Página 9
Pseudocódigo #3: Array
1. Inicio 2. Variables (N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N11, N12, N13, N14, N15 : real : Trabajo=0) \ Se iniciaran todas las variables con el valor cero 3. Escribir “Ingrese Numero 1” 4. Leer N1 5. Escribir “Ingrese Numero 2” 6. Leer N2 7. Escribir “Ingrese Numero 3” 8. Leer N3 9. Escribir “Ingrese Numero 4” 10.Leer N4 11. Escribir “Ingrese Numero 5” 12. Leer N5 13. Escribir “Ingrese Numero 6” 14. Leer N6 15. Escribir “Ingrese Numero 7” 16. Leer N7 17. Escribir “Ingrese Numero 8” 18. Leer N8 19. Escribir “Ingrese Numero 9” 20. Leer N9 21. Escribir “Ingrese Numero 10” 22. Leer N10‟ 23. Escribir “Ingrese Numero 11” 24. Leer N11 25. Escribir “Ingrese Numero 12” 26. Leer N12 27. Escribir “Ingrese Numero 13”28. Leer N13 29. Escribir “Ingrese Numero 14” 30. Leer N14 31. Escribir “Ingrese Numero 15” 32. Leer N15 33. Escribir N1,N3, N5, N7,N9, N11, N13, N15 34. FIN
UNIPOLI
Andrés Ortiz
Página 10
Diagrama de Flujo #3: Array
INICIO
N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N11, N12, N13, N14, N15 : Real :Trabajo=0
„‟Ingrese Numero 1‟‟
N1
„‟Ingrese Numero 2‟‟
N2
„‟IngreseNumero 3‟‟
N3
„‟Ingrese Numero 4‟‟
N7
„‟Ingrese Numero 7‟‟
N6
„‟Ingrese Numero 6‟‟
N5
„‟Ingrese Numero 5‟‟
N4
„‟Ingrese Numero 8‟‟
N8
„‟Ingrese Numero 9‟‟
N9
„‟Ingrese Numero 10‟‟
N10
„‟Ingrese Numero 11‟‟
N14
„‟Ingrese Numero 14‟‟
N13
„‟Ingrese Numero 13‟‟
N12
„‟Ingrese Numero 12‟‟
N11
„‟Ingrese Numero 15‟‟
N15
N1,N3, N5,N7,N9, N11, N13, N15
Fin
UNIPOLI
Andrés Ortiz
Página 11
Diagrama N-S #3: Array
UNIPOLI
Andrés Ortiz
Página 12
Problema 4
Desarrolle un algoritmo que permita leer un valor entero positivo N y determinar si es primo o no.
Algoritmo #4: Numero Primo
Salidas
Numero Primo, Numero no Primo
Entradas
Contador=0 Para (cuando i=num && i>=1 && i--) Si (n%i == 0)Contador++ Si (contador>2) Escribir “ No Es numero Primo” Cuando No Escribir”Es numero primo”
Procesos
Num
Pseudocódigo #4: Números Primos
1. Inicio 2. Variables ( Num ,Cont, array[i] : Natural : trabajo=0) \ Se iniciaran todas las variables con el valor cero
3. Escribir “Ingrese Numero” 4. Leer Num ( 5. For (int i=n; i>1; i--) 5.2.1 If (n%i==0) {contador++} \ si el residuo de la división...
Regístrate para leer el documento completo.