Source Code :
public class MenghitungLuasSegitiga {
String Alas;
String Tinggi;
public static void main(String[] args) {
Segitiga a = new Segitiga();
Segitiga b = new Segitiga();
Segitiga c = new Segitiga();
Segitiga d = new Segitiga();
Segitiga e = new Segitiga();
int A1=6, A2=7, A3=11, A4=14, A5=4;
int T1=9, T2=5, T3=7, T4=8, T5=8;
System.out.println("Alas = "+A1+"\nTinggi = "+T1+"\n1/2 Alas x Tinggi = "+(A1/2)*T1);
System.out.println("Alas = "+A2+"\nTinggi = "+T2+"\n1/2 Alas x Tinggi = "+(A2/2)*T2);
System.out.println("Alas = "+A3+"\nTinggi = "+T3+"\n1/2 Alas x Tinggi = "+(A3/2)*T3);
System.out.println("Alas = "+A4+"\nTinggi = "+T4+"\n1/2 Alas x Tinggi = "+(A4/2)*T4);
System.out.println("Alas = "+A5+"\nTinggi = "+T5+"\n1/2 Alas x Tinggi = "+(A5/2)*T5);
}
}
0 komentar:
Posting Komentar