Tabel Ganda Lanjutan

Assalamualaikum, . .
Kali ini saya akan membagikan tentang Tbel ganda lanjutan pada pemrograman java, .
Silahkan dicoba, . .

public class AnotherDoubleTable {

public static void main(String[] iriahus) {
final double MILES_TO_KM = 1.609;
final double KM_TO_MILES = 0.621;
final int COUNT = 10;
int i = 1;
int j = 20;

System.out.println("Miles\t    Kilometers  |  Kilometers\t    Miles");
System.out.println("----------------------  |  ----------------------");

while (i <= COUNT) {
System.out.printf(i + "\t  %12.3f  |  " + j +
"\t     %12.3f\n", (i * MILES_TO_KM), (j * KM_TO_MILES));
i++;
j += 5;
}

}

}

Semoga bermanfaat, . .

Subscribe to receive free email updates:

0 Response to "Tabel Ganda Lanjutan"

Post a Comment