diff --git a/1ano/2semestre/poo/out/production/poo/aula02/SecsToHMS.class b/1ano/2semestre/poo/out/production/poo/aula02/SecsToHMS.class index 8f6ac3d..6f8c06b 100644 Binary files a/1ano/2semestre/poo/out/production/poo/aula02/SecsToHMS.class and b/1ano/2semestre/poo/out/production/poo/aula02/SecsToHMS.class differ diff --git a/1ano/2semestre/poo/src/aula02/SecsToHMS.java b/1ano/2semestre/poo/src/aula02/SecsToHMS.java index 20b3aad..d276bd0 100644 --- a/1ano/2semestre/poo/src/aula02/SecsToHMS.java +++ b/1ano/2semestre/poo/src/aula02/SecsToHMS.java @@ -15,10 +15,10 @@ public class SecsToHMS { System.out.println("Introduza os segundos totais: "); int totalSecs = (int) UserInput.getPositiveNumber(sin); int secs = totalSecs % 60; - int mins = Math.round((float) (totalSecs / 60)); - int hours = Math.round((float) (mins / 60)); + int mins = totalSecs / 60; + int hours = mins / 60; mins = mins % 60; - System.out.printf("%d segundos no formato hh:mm:ss : %d:%d:%d\n", totalSecs, hours, mins, secs); + System.out.printf("%d segundos no formato hh:mm:ss : %02d:%02d:%02d\n", totalSecs, hours, mins, secs); sin.close(); }