Advertisement
diegokr

Psedudocódigo - Combinados Ejercicio 6

Oct 31st, 2019
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. #Ejercicio 6 - Pseudocódigo Combinados 2019
  2. #Autor: Diego Krauthamer
  3.  
  4. #Declaración de variables
  5. cantcan=0
  6. tiempotot=0
  7. nombre=""
  8. duracion=-1
  9. continuar="S"
  10.  
  11. #Cuerpo principal del programa
  12. mientras(continuar="S")
  13.  
  14. #Inicializacion de variables
  15. nombre=""
  16. duracion=-1
  17. continuar="Z"
  18.  
  19. #Ingreso y validacion de nombre la cancion
  20. mientras(nombre="")
  21. mostrar("Ingrese nombre")
  22. leer(nombre)
  23.  
  24. #Mensaje de error
  25. si(nombre="") entonces
  26. mostrar("ERROR - Ingrese nombre correcto")
  27. fin si
  28. fin mientras
  29.  
  30. #Ingreso y validacion de la duracion de la cantalla
  31. mientras(duracion <=0)
  32. mostrar("Ingrese duracion en minutos")
  33. leer(duracion)
  34.  
  35. #Mensaje de error
  36. si(duracion <=0) entonces
  37. mostrar("ERROR - Ingrese duracion correcta")
  38. fin si
  39. fin mientras
  40.  
  41. cantcant=cantcan+1 #Incremento contador de canciones
  42. tiempotot=tiempotot+duracion #Acumulo la duracion de cancion
  43.  
  44. #Pregunto al usuario si desea continuar
  45. mientras(continuar <> "S" y continuar <>"N")
  46. mostrar("Desea continuar S/N")
  47. leer(continuar)
  48.  
  49. si(continuar <> "S" y continuar <>"N") entonces
  50. mostrar("Error - ingrese S o N")
  51. fin si
  52. fin mientras
  53. Fin mientras
  54.  
  55. #Salida por pantalla
  56. mostrar("Cantidad de canciones:"cantcan)
  57. mostrar("Tiempo Total:",tiempotot)
  58. mostrar("Tiempo Total en horas:",tiempotot/60)
  59. mostrar("Promedio:",tiempotot/cantcan)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement