Berikut ini adalah hasilnya setelah di build+run:
import java.io.*;
{
public static void
main (String[]args) throws IOException
{
String NIM, nama;
String temp1;
double r=0, L, K;
BufferedReader
baru=new BufferedReader(new InputStreamReader (System.in));
System.out.println();
System.out.print
("Masukkan NIM : ");
NIM=
baru.readLine();
System.out.print
("Masukkan jari-jari : ");
//temp1=
baru.readLine();
//r=Double.parseDouble(temp1);
r=Double.parseDouble(baru.readLine());
L=3.14*r*r;
K=3.14*2*r;
System.out.println("=====================================");
System.out.println();
System.out.println
("NIM Anda : " +NIM);
System.out.println
("Jari-jari : " +r);
System.out.println
("Luas : " +L);
System.out.println
("Keliling : " +K);
}
}
Tidak ada komentar:
Posting Komentar
Pembaca yang budiman.
Silakan tinggalkan komentar.
We'll be glad to respond your comment(s). ^_^