private static Object JOptionPane;
int panjang;
int lebar;
double luas;
double kell;
public void keliling (){
kell = 2*(panjang*lebar);
System.out.println("kelilingnya adalah = "+kell);
}
public void luas(){
luas= panjang*lebar;
System.out.println("luasnya adalah= "+luas);
}
public void ket(){
System.out.println("panjang persegi panjang = "+panjang);
System.out.println("Lebar persegi panjang = "+lebar);
}
public double getpanjang(){
System.out.println(getpanjang());
return 0;
}
public double getlebar(){
System.out.println(getlebar());
return 0;
}
public void sisi(){
System.out.println("panjang"+panjang);
}
public void sisi(double temp){
System.out.println("lebar"+lebar);
}
public void sisi(double a, double b ){
System.out.println("luas"+luas);
System.out.println("keliling"+kell);
}
public static void main(String[] args) {
Algo2 a = new Algo2();
a.setlebar(10);
a.setpanjang(10);
a.ket();
a.luas();
a.keliling();
a.sisi();
a.sisi(0);
a.sisi(1, 2);
}
}
Posted by 01.49 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar