Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class MilestoKilometers
  3. {
  4. public static void main(String[] args)
  5. {
  6. int meters;
  7. float Kilometers;
  8. Scanner scan = new Scanner(System.in) ;
  9.  
  10. // get the Miles from the user
  11. System.out.println("Please Input your Miles and i will conver them to Kilometers");
  12.  
  13. Scanner input= new Scanner(System.in);
  14.  
  15. meters=input.nextInt();
  16.  
  17.  
  18.  
  19. //compute the Kilometers
  20.  
  21. Kilometers= (float) ((meters) *1.60936);
  22.  
  23. //print the average
  24.  
  25. System.out.println("The Kilometers are: "+Kilometers);
  26.  
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement