Wahyu Bagus Susilo
2012420098
Mencari Luas persegi
public class
persegi {
public String nama;
public String nim;
public double sisi;
public double luas;
void print (){
System.out.println("Nama="+"\t"+nama);
System.out.println("Nim="+"\t"+nim);
System.out.println("Sisi="+"\t"+sisi);
}
void hitung(){
luas=sisi*sisi;
System.out.println("luas="+"\t"+luas);
}
}
public static
void main(String[] args) {
persegi x=new persegi();
x.nama="wahyu bagus susilo";
x.nim="2012420098";
x.sisi=12;
x.print();
x.hitung();
}
}
Posted by 11.25 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar