package variables;

public class Example {

    // conversion factor: # of km in a mile
    public static final double MILES_TO_KM = 1.60934;

    public static void main(String[] args) {

        double miles = 10; // miles we want to convert

        // convert to km
        double kms = miles * MILES_TO_KM;

        // display the results
        System.out.printf("%.1f miles is equal to %.1f kilometers.\n",
                miles, kms);

        /*
         * Exercise:
         * Add some code so that we can include how many feet in the
         * miles variable value and how many meters that is.
         * There are 5280 feet in a mile.
         * There is .3048 feet in a meter and 1000 meters in a kilometer.
         * Your output should read:
         * That's 52800.0 feet and 16093.4 meters.
         * (assuming you've used 10 as the value for miles)
         * Use constants for the conversion factors you decide to use.
         */











         
        /*
         * solution
         *
         * add the constants at the top:
         * public static final double FEET_IN_MILE = 5280;
         * 
         * public static final double METERS_IN_KM = 1000;
         * OR
         * public static final double FEET_IN_METER = .3048;
         * 
         * add to main():
         * double feet = miles * FEET_IN_MILE;
         * double meters = kms * METERS_IN_KM;
         * OR
         * double meters = feet * FEET_IN_METER;
         * 
         * System.out.printf("That's %.1f feet and %.1f meters.\n",
         * feet, meters);
         * 
         */
    }
}
