Advertisement
LordKusa

Clase 03 - Ejercicio 09

Apr 1st, 2019
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. Proceso Marca_Tiempo
  2.  
  3. //Diseñe un algoritmo para sumar dos marcas de tiempo dadas en dias, horas, minutos y segundos
  4.  
  5. Definir S1, S2, S3, SM, M1, M2, M3, MH, H1, H2, H3, HD, D1, D2, D3 Como Entero
  6.  
  7. Escribir "Ingrese la primer marca de tiempo."
  8. Escribir "Ingrese segundos."
  9. Leer S1
  10. Escribir "Ingrese minutos."
  11. Leer M1
  12. Escribir "Ingrese horas."
  13. Leer H1
  14. Escribir "Ingrese dias."
  15. Leer D1
  16.  
  17. Escribir "Ingrese la segunda marca de tiempo."
  18. Escribir "Ingrese segundos."
  19. Leer S2
  20. Escribir "Ingrese minutos."
  21. Leer M2
  22. Escribir "Ingrese horas."
  23. Leer H2
  24. Escribir "Ingrese dias."
  25. Leer D2
  26.  
  27. SM <- Trunc((S1+S2)/60)
  28. S3 <- (S1+S2) Mod 60
  29. MH <- Trunc((M1+M2+SM)/60)
  30. M3 <- (M1+M2+SM) Mod 60
  31. HD <- Trunc((H1+H2+MH)/24)
  32. H3 <- (H1+H2+MH) Mod 60
  33. D3 <- HD+D1+D2
  34.  
  35. Escribir "La marca de tiempo total es ", D3, ":", H3, ":", M3, ":", S3
  36.  
  37. FinProceso
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement