Skip to content

Instantly share code, notes, and snippets.

@nxman3
nxman3 / Mile to km
Last active October 9, 2015 01:33
adding comments
import java.util.Scanner; //Importing Utility Scanner
public class Assignment1
{
static Scanner sc=new Scanner(System.in); //Scanner
static final double CONVERT_MILES=1.609; //Constant Value
public static void main(String[]args) //Always have a main method
{System.out.print("Enter number of miles: ");//command line prints Enter number miles here
double numMile=sc.nextDouble();//Scanner scans for the users inout