import java.io.*;
public class uts {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
BufferedReader hitung = new BufferedReader(new InputStreamReader(System.in));
double alas,tinggi,luas,keliling,miring;
String a="", t="", cari="";
int x;
try
{
System.out.println(" MENU UTAMA ");
System.out.println("======================================");
System.out.println("1. Cari Sisi Miring Segitiga Sama Kaki");
System.out.println("2. Hitung Luas Segitiga Sama Kaki");
System.out.println("3. Hitung Keliling Segitiga Sama Kaki");
System.out.println("======================================");
System.out.print("Pilihan Anda : ");
cari = hitung.readLine();
System.out.println("");
x = Integer.parseInt(cari);
if (x == 1)
{
System.out.print("Masukkan Nilai Alas : ");
a = hitung.readLine();
System.out.print("Masukkan Nilai Tinggi : ");
t = hitung.readLine();
alas = Double.parseDouble(a);
tinggi = Double.parseDouble(t);
miring = ((alas*alas)+(tinggi*tinggi));
System.out.println("Sisi Miring Segitiga = " + Math.sqrt(miring));
}
else if (x == 2)
{
System.out.print("Masukkan Nilai Alas : ");
a = hitung.readLine();
System.out.print("Masukkan Nilai Tinggi : ");
t = hitung.readLine();
alas = Double.parseDouble(a);
tinggi = Double.parseDouble(t);
luas = 0.5 * alas * tinggi;
System.out.println("Luas Segitiga = " + luas);
}
else if (x == 3)
{
System.out.print("Masukkan Nilai Alas : ");
a = hitung.readLine();
System.out.print("Masukkan Nilai Tinggi : ");
t = hitung.readLine();
alas = Double.parseDouble(a);
tinggi = Double.parseDouble(t);
miring = ((alas*alas)+(tinggi*tinggi));
keliling = (2*miring)+alas;
System.out.println("Keliling Segitiga = " + keliling);
}
else
{
System.out.println("Maaf Pilihan Anda tidak Tersedia !!!!");
}
}
catch (IOException e)
{
System.out.println("Error");
}
}
}
public class uts {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
BufferedReader hitung = new BufferedReader(new InputStreamReader(System.in));
double alas,tinggi,luas,keliling,miring;
String a="", t="", cari="";
int x;
try
{
System.out.println(" MENU UTAMA ");
System.out.println("======================================");
System.out.println("1. Cari Sisi Miring Segitiga Sama Kaki");
System.out.println("2. Hitung Luas Segitiga Sama Kaki");
System.out.println("3. Hitung Keliling Segitiga Sama Kaki");
System.out.println("======================================");
System.out.print("Pilihan Anda : ");
cari = hitung.readLine();
System.out.println("");
x = Integer.parseInt(cari);
if (x == 1)
{
System.out.print("Masukkan Nilai Alas : ");
a = hitung.readLine();
System.out.print("Masukkan Nilai Tinggi : ");
t = hitung.readLine();
alas = Double.parseDouble(a);
tinggi = Double.parseDouble(t);
miring = ((alas*alas)+(tinggi*tinggi));
System.out.println("Sisi Miring Segitiga = " + Math.sqrt(miring));
}
else if (x == 2)
{
System.out.print("Masukkan Nilai Alas : ");
a = hitung.readLine();
System.out.print("Masukkan Nilai Tinggi : ");
t = hitung.readLine();
alas = Double.parseDouble(a);
tinggi = Double.parseDouble(t);
luas = 0.5 * alas * tinggi;
System.out.println("Luas Segitiga = " + luas);
}
else if (x == 3)
{
System.out.print("Masukkan Nilai Alas : ");
a = hitung.readLine();
System.out.print("Masukkan Nilai Tinggi : ");
t = hitung.readLine();
alas = Double.parseDouble(a);
tinggi = Double.parseDouble(t);
miring = ((alas*alas)+(tinggi*tinggi));
keliling = (2*miring)+alas;
System.out.println("Keliling Segitiga = " + keliling);
}
else
{
System.out.println("Maaf Pilihan Anda tidak Tersedia !!!!");
}
}
catch (IOException e)
{
System.out.println("Error");
}
}
}
0 komentar:
Post a Comment
Tinggalkan Komentar Disini