// ColumbusNew.java Copyright (c) Kari Laitinen // http://www.naturalprogramming.com // 2002-11-24 Original program file created. // 2012-11-14 This program was made to use the newer ISODate class. // 2012-11-14 Last modification. // When this program is compiled, the file ISODate.java // must be in the same folder (directory) together with this file. class ColumbusNew { public static void main( String[] not_in_use ) { // Date information must be provided for the ISODate class in // the ISO format YYYY-MM-DD. ISODate date_of_discovery_of_america = new ISODate( "1492-10-12" ) ; ISODate date_of_first_moon_landing = new ISODate( "1969-07-20" ) ; System.out.print( "\n Christopher Columbus discovered America on " + date_of_discovery_of_america + "\n That was a " + date_of_discovery_of_america.get_day_of_week() + "." ) ; System.out.print( "\n\n Apollo 11 landed on the moon on " + date_of_first_moon_landing + "\n That was a " + date_of_first_moon_landing.get_day_of_week() + "." ) ; // The method get_distance_to() delivers the chronological distance // in an array of type int, that must be created before we // call the method. int[] chronological_distance = new int[ 3 ] ; date_of_discovery_of_america.get_distance_to( date_of_first_moon_landing, chronological_distance ) ; System.out.print( "\n\n America was discovered " + chronological_distance[ 0 ] + " years, " + chronological_distance[ 1 ] + " months, and " + chronological_distance[ 2 ] + " days" + "\n before the first moon landing.\n" ) ; } }