public class lingkaran {
public double pi=3.14, kell, vol;
public float luas;
public int r, t;
String alas;
public void r(){
Scanner in= new Scanner(System.in);
r = in.nextInt();
}
public void t(){
Scanner in= new Scanner(System.in);
t = in.nextInt();
}
public void kell(){
kell=2*pi*r;
System.out.println("Keliling Alas: "+kell);
}
public void luas(){
luas=(float) (pi*(r*r));
System.out.println("Luas Alas: "+luas);
}
public void vol(){
vol=luas*t;
System.out.println("Volume Tabung: "+vol);
}
public static void main(String[] args) {
// TODO code application logic here
lingkaran x=new lingkaran();
System.out.print("jari-jari alas: ");
x.r();
System.out.print("tinggi tabung: ");
x.t();
x.kell();
x.luas();
x.vol();
Nama: Ria Suryani
NIM: 2012420033
Kelas: A
Posted by 00.48 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar