// HeightToLightYears.java Copyright (c) 2006 Kari Laitinen // http://www.naturalprogramming.com // 2006-02-12 File created. // 2006-02-12 Last modification. // This file is a solution to Exercise 5-6. import java.util.* ; class HeightToLightYears { public static void main( String[] not_in_use ) { Scanner keyboard = new Scanner( System.in ) ; double height_in_centimeters, height_in_light_years ; System.out.print( "\n This program converts your height to light years." + "\n Please, enter your height in centimeters: " ) ; height_in_centimeters = keyboard.nextDouble() ; height_in_light_years = height_in_centimeters / ( 2.99793e8 * (( 365 * 24 ) + 6 ) * 3600 * 100 ) ; System.out.printf( "\n Your height in light years is %15.5e \n", height_in_light_years ) ; } }