class Time { int h, m, s; /* hours, minutes, seconds */ } class UseTime { static Time convert (int seconds){ Time t = new Time(); t.h = seconds / 3600; t.m = (seconds % 3600) / 60; t.s = seconds % 60; return t; } public static void main (String[] args) { int seconds=(2*60+18)*60+12; Time theTime = convert(seconds); System.out.println(seconds+" seconds are "+ theTime.h+" hours "+ theTime.m+" minutes and "+ theTime.s+" seconds"); } }