Monday, January 7, 2008

UAS C++

#include
#include
#define phi 3.14


void keterangan()
{
clrscr();
cout<<<" |========================================|"<<<" | Nama : Ketut Ugi diranta |"<<<" | NIM : 070010403 |"<<<" | Kelas : M071 |"<<<" |========================================|"<<<" | |"<<<" | Menu Pilihan : |"<<<" | |"<<<" | 1. Pembagian |"<<<" | 2. Menghitung Luas Segitiga |"<<<" | 3. Menghitung Keliling Segitiga |"<<<" | 4. Menghitung Luas Lingkaran |"<<<" | 5. Menghitung Keliling Lingkaran |"<<<" | 6. Menghitung Volume Silinder |"<<<" | |"<<<" |========================================|"<<<<" >> Menu Pilihan Anda Adalah : ";
}


void pembagian()
{
float e,g,h;

clrscr();
cout<<"Masukan angka 1 = "; cin>>g;
cout<<"Masukan angka 2 = "; cin>>h;
e=g/h;
cout<<<"Hasil Pembagian = "<<<" / "<<<" = "<<<<<"Masukan alas = "; cin>>a;
cout<<"Masukan tinggi = "; cin>>b;
e=0.5*a*b;
cout<<<"Luas Segitiga : "<<"0,5 * "<<<" * "<<<" = " <<<<<"Masukan alas = "; cin>>a;
cout<<"Masukan tinggi = "; cin>>b;
c=a*b;
cout<<<"Keliling Segitiga : "<
<<" * "<<<" = " <<<<<"Inputkan jari-jari lingkaran = "; cin>>r;
luas = phi*(r*r);
cout<<<"Luas lingkaran : "<<<" * "<<<" * "<<< " = "<<<<<"Inputkan jari-jari lingkaran = "; cin>>r;
kel = 2 * phi * r;
cout<<<"Keliling lingkaran : "<<"2"<<" * "<<<" * "<<<" = "<<<<<"Masukan jari-jari = "; cin>>a;
cout<<"Masukan tinggi = "; cin>>b;
e=3.14*a*a*b;
cout<<<"Volume Silinder : "<<"3.14 * "<
<<" * "<<<" * "<<<" = " <<<>z;

if (z==1)
{
pembagian();
}
else
if (z==2)
{
luas_segitiga();
}
else
if (z==3)
{
keliling_segitiga();
}
else
if (z==4)
{
luas_lingkaran();
}
else
if (z==5)
{
keliling_lingkaran();
}
else
{
volume_silinder();
}
cout<<"Ingin inputkan data lagi (Y/T)? "; cin>>i;
}

while (i=='y');
getch ( );

}

About This Blog

About This Blog

  © Blogger template Brooklyn by Ourblogtemplates.com 2008

Back to TOP