First+Java+Project

/** milesToKilometersConverter.java convert miles to kilometers
 * @author Danny Fell

import java.util.Scanner; public class milesToKilometersConverter {

public static void main(String[] args) {

System.out.print ("How many miles do you want to convert into kilometers? "); // asks user how many miles they want to convert

Scanner kbd1 = new Scanner (System.in);

double milesToBeConverted = kbd1.nextDouble ; // user input establishes miles to be converted

double kilometers = milesToBeConverted / 0.621371192; // converting the miles into kilometers math

if (milesToBeConverted < 0)

{

System.out.print ("Cannot convert negative miles because that's impossible!"); // tells user they cannot input negative miles

}

else

{

System.out.println (milesToBeConverted + " miles => " + kilometers + " kilometers"); // tells user how many kilometers their input miles =

}

} }