Anda di halaman 1dari 4

public class lat1 {

public static void main (String[] args) {


int ls,kll,p,l;
p=10;
l=4;
ls=p*l;
kll=2*(p+l);
System.out.println("Panjang ::"+p);
System.out.println("Lebar ::"+l);
System.out.println("Luas ::"+ls);
System.out.println("Keliling ::"+kll);
}
}

public class lat2 {


public static void main (String[] args) {
final double jr=3.14;
int r;
double kll,ls,akr;
r=10;
kll=r*jr*2;
ls=r*r*jr;

System.out.println("Latihan 2 : tentang lingksran ::");


System.out.println("jari-jari :"+r);
System.out.println("keliling :"+Math.floor(kll));
System.out.println("luas :"+Math.floor(ls));
}
}

public class lat3 {


public static void main (String[] args) {
double kll,ls,s1,s2,s3,t;

s1=4;
s2=5;
s3=6;
t=5;

kll=s1+s2+s3;
ls=0.5*s1*t;

System.out.println("Latihan 2 : tentang segitiga sama sisi ::");


System.out.println(" sisi 1 : :"+s1);
System.out.println(" sisi 2 : :"+s2);
System.out.println(" sisi 3 : :"+s3);
System.out.println(" Tinggi : :"+kll);
System.out.println(" Keliling : :"+kll);
System.out.println(" luas : :"+ls);
}
}

public class lat4 {


public static void main (String[] args) {
double kll,jm,t,ls,s1,s2,s3,s4;

jm=4;
t=10;
s1=5;
s2=4;
s3=6;
s4=7;
ls=0.5*jm*t;
kll=s1+s2+s3+s4+t;

System.out.println("Latihan 2 : tentang segitiga sama sisi ::");


System.out.println(" jumlah sisi ::"+jm);
System.out.println(" tinggi "+t);
System.out.println(" sisi 1: "+s1);
System.out.println(" sisi 2: "+s2);
System.out.println(" sisi 3: "+s3);
System.out.println(" sisi 4: "+s4);
System.out.println(" luas: "+Math.floor(ls));
System.out.println(" keliling: "+Math.floor(kll));
}
}