// Titanic.java (c) 2005 Kari Laitinen // http://www.naturalprogramming.com // 2004-10-06 File created. // 2005-07-25 Last modification. // When this program is compiled, Date.java, DateDistance.java, // and CurrentDate.java must be in the same folder (directory) // together with this file. // Compile in MS-DOS window: javac Titanic.java // Execute in MS-DOS window: java Titanic class Titanic { public static void main( String[] not_in_use ) { Date date_when_titanic_sank = new Date( "04/15/1912" ) ; CurrentDate date_of_today = new CurrentDate() ; DateDistance time_from_sinking = date_of_today.get_distance_to( date_when_titanic_sank ) ; System.out.print( "\n Today it is " + date_of_today + ".\n On " + date_when_titanic_sank + ", the famous ship \"Titanic\" went to" + "\n the bottom of Atlantic Ocean." + "\n That happened " + time_from_sinking.years + " years, " + time_from_sinking.months + " months, and " + time_from_sinking.days + " days ago. \n\n" ) ; } }