Write a class TimeSplit that reads a number of seconds (a positive int) and prints it as hours, minutes and seconds, exactly in this form:
3671 seconds = 1 h 1 min 11 s
Use integer division / and the remainder % — no loops.
THINK FIRST·CODE LATER
Problem
Write a class TimeSplit that reads a number of seconds (a positive int) and prints it as hours, minutes and seconds, exactly in this form:
3671 seconds = 1 h 1 min 11 s
Use integer division / and the remainder % — no loops.
Write it here or in your IDE, then paste it. Compile and test it yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.
Model solution