Advertisement
satriafu5710

Konversi Jarak Mil ke Km Java

Jan 19th, 2022
1,511
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.tutorial;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner userInput = new Scanner(System.in);
  10.  
  11.         double mil, hasil;
  12.  
  13.         double km = 1.60934; // Jarak 1 Mil dalam Km
  14.  
  15.         System.out.println("\n\t Konversi Jarak Mil ke Jarak Km \n");
  16.  
  17.         System.out.print(" Berapa Mil : ");
  18.         mil = userInput.nextDouble();
  19.  
  20.         System.out.println("");
  21.  
  22.         hasil = mil * km;
  23.         System.out.println(" " + mil + " Mil = " + hasil + " Km.");
  24.  
  25.         System.out.println("");
  26.     }
  27. }
  28.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement