Christian.java

/**KilometersToMilesConverter.java converts Kilometers to miles


 * @version 1.0


 * @author Christian Nanson



import java.util.Scanner; public class KilometersToMilesConverter {

public static void main(String[] args) {

System.out.print("How many kilometers do you wish to convert into miles?"); //This asks the user for the kilometers.

Scanner keyboard = new Scanner(System.in); //Java 1.5 or later

double kilometers = keyboard.nextDouble; //This sets up the value of kilometers.

double miles = kilometers*.621371192; //This sets up the value for miles.

System.out.printf("%.2f Kilometers => %.2f Miles", kilometers, miles); //This is the conversion equation.

} }