Menghitung Luas Persegi Panjang, Persegi, Segitiga, Jajaran Genjang dan Layang-layang
Dosen Pengampu : Fince Tinus Waruwu, S.Kom, M.Kom
package rosliana;
public class rosliana {
public static void main(String[] args) {
int p = 3;
int l = 4;
int Luas_Persegi_Panjanng;
Luas_Persegi_Panjanng = p*l;
System.out.println("Panjang = "+p);
System.out.println("Lebar = "+l);
System.out.println ("Hasil Luas Persegi Panjang= "+Luas_Persegi_Panjanng);
System.out.println ("===================================================");
int s1 = 7;
int s2 = 7;
int Luas_Persegi;
Luas_Persegi = s1*s2;
System.out.println("Sisi 1="+s1);
System.out.println("Sisi 2="+s2);
System.out.println ("Hasil Luas Persegi = "+Luas_Persegi);
System.out.println ("===================================================");
double a = 3;
double t = 4;
double Luas_Segitiga;
Luas_Segitiga = 0.5*a*t;
System.out.println("Alas = "+a);
System.out.println("Tinggi = "+t);
System.out.println ("Hasil Luas Segitiga = "+Luas_Segitiga);
System.out.println ("===================================================");
int A = 8;
int T = 4;
int Luas_Jajaran_Genjang;
Luas_Jajaran_Genjang = A*T;
System.out.println("Alas="+A);
System.out.println("Tinggi="+T);
System.out.println ("Hasil Luas Jajaran Genjang = "+Luas_Jajaran_Genjang);
System.out.println ("===================================================");
double d1 = 8;
double d2 = 9;
double Luas_Layang_layang;
Luas_Layang_layang = 0.5*d1*d2;
System.out.println("Diagonal 1="+d1);
System.out.println("Diagonal 2="+d2);
System.out.println ("Hasil Luas Layang-layang = "+Luas_Layang_layang);
System.out.println ("===================================================");
}
}
Maka akan tampil seperti gambar yang ada di bawah ini :
package rosliana;
public class rosliana {
public static void main(String[] args) {
int p = 3;
int l = 4;
int Luas_Persegi_Panjanng;
Luas_Persegi_Panjanng = p*l;
System.out.println("Panjang = "+p);
System.out.println("Lebar = "+l);
System.out.println ("Hasil Luas Persegi Panjang= "+Luas_Persegi_Panjanng);
System.out.println ("===================================================");
int s1 = 7;
int s2 = 7;
int Luas_Persegi;
Luas_Persegi = s1*s2;
System.out.println("Sisi 1="+s1);
System.out.println("Sisi 2="+s2);
System.out.println ("Hasil Luas Persegi = "+Luas_Persegi);
System.out.println ("===================================================");
double a = 3;
double t = 4;
double Luas_Segitiga;
Luas_Segitiga = 0.5*a*t;
System.out.println("Alas = "+a);
System.out.println("Tinggi = "+t);
System.out.println ("Hasil Luas Segitiga = "+Luas_Segitiga);
System.out.println ("===================================================");
int A = 8;
int T = 4;
int Luas_Jajaran_Genjang;
Luas_Jajaran_Genjang = A*T;
System.out.println("Alas="+A);
System.out.println("Tinggi="+T);
System.out.println ("Hasil Luas Jajaran Genjang = "+Luas_Jajaran_Genjang);
System.out.println ("===================================================");
double d1 = 8;
double d2 = 9;
double Luas_Layang_layang;
Luas_Layang_layang = 0.5*d1*d2;
System.out.println("Diagonal 1="+d1);
System.out.println("Diagonal 2="+d2);
System.out.println ("Hasil Luas Layang-layang = "+Luas_Layang_layang);
System.out.println ("===================================================");
}
}
Maka akan tampil seperti gambar yang ada di bawah ini :
Komentar
Posting Komentar