home *** CD-ROM | disk | FTP | other *** search
- /*
- Convert.class prints a short table of common conversion factors.
- */
-
- class Convert {
-
- /*
- * Note that the main method must be defined as
- * public static void main (String []) to be called from
- * the Java interpreter.
- */
-
- public static void main (String args[]) {
-
- double mi_to_km = 1.609;
- double gals_to_l = 3.79;
- double kg_to_lbs = 2.2;
-
- System.out.print ("1 Mile equals\t");
- System.out.print (mi_to_km);
- System.out.println ("\tKilometers");
-
- System.out.print ("1 Gallon equals\t");
- System.out.print (gals_to_l);
- System.out.print ("\tLiters\n");
-
- System.out.print ("1 Kilogram equals\t");
- System.out.print (kg_to_lbs);
- System.out.println ("\tPounds");
- }
- }