// Fig. 8.1: Time1java //Time1 class declaration maintains the time in 24-hour format. public class Time1 { int hour; int minute; int second; public void setTime( int h, int m, int s) { if ( ( h >= 0 && h < 24 ) && ( m >= 0 && m < 60 ) && ( s >= 0 && s < 60 ) ) { hour = h; minute = m; second = s; } else throw new IllegalArgumentException( "hour, minute and/our second was out of range"); } public String toUniversalString() { return String.format("%02d:02d:%02d", hour,minute,second); } public String toString() { return String.format("%d:%d02:%d02 %s", ( ( hour == 0 || hour == 12 ) ? 12 : hour % 12 ), minute, second, (hour < 12 ? "AM" : "PM" ) ) ; } } // Fig.8.2: Time1Test.java // Time1 object used in ...