#include <conio.h>
void main()
{ int kode; //tampilan utama
cout<<"|*****************************************|"<<endl;
cout<<"|*****************************************|"<<endl;
cout<<"| Nama : Khoirul As Ari |"<<endl;
cout<<"| Nim : 120103119 |"<<endl;
cout<<"|*****************************************|"<<endl;
cout<<"|*****************************************|"<<endl;
cout<<"| PROGRAM PERHITUNGAN |"<<endl;
cout<<"|=========================================|"<<endl;
cout<<"| PILIHAN KODE |"<<endl;
cout<<"|=========================================|"<<endl;
cout<<"|1. Menghitung luas lingkaran |"<<endl;
cout<<"|2. Menghitung ukuran tinggi badan |"<<endl;
cout<<"|=========================================|"<<endl;
cout<<"MASUKKAN PILIHAN ANDA :";cin>>kode; //pemasukan kode
if (kode==1)
{
clrscr();
float j,luas; //penghitungan luas lingkaran
cout<<"|*****************************************|"<<endl;
cout<<"|*****************************************|"<<endl;
cout<<"| Nama : Khoirul As Ari |"<<endl;
cout<<"| Nim : 120103119 |"<<endl;
cout<<"|*****************************************|"<<endl;
cout<<"|*****************************************|"<<endl;
cout<<"| MENGHITUNG LUAS LINGKARAN |"<<endl;
cout<<"|=========================================|"<<endl;
cout<<"MASUKKAN JARI-JARI :";cin>>j;
luas=3.14*j*j;
cout<<luas;
}
else if (kode==2)
{
clrscr();
int u; //penentuan ukuran badan
cout<<"|*****************************************|"<<endl;
cout<<"|*****************************************|"<<endl;
cout<<"| Nama : Khoirul As Ari |"<<endl;
cout<<"| Nim : 120103119 |"<<endl;
cout<<"|*****************************************|"<<endl;
cout<<"|*****************************************|"<<endl;
cout<<"| MENENTUKAN UKURAN BADAN ANDA |"<<endl;
cout<<"|=========================================|"<<endl;
cout<<"MASUKKAN UKURAN BADAN ANDA :";cin>>u;
if (u>=180)
{
cout<<"ANDA MEMILIKI UKURAN BADAN YANG TINGGI";
}
else if (u>=155&&u<=179)
{
cout<<"ANDA MEMILIKI UKURAN BADAN YANG SEDANG";
}
else if (u<155)
{
cout<<"ANDA MEMILIKI UKURAN BADAN YANG RENDAH";
}
}
else //jika kode yang dimasukkan salah
{
cout<<"\nMaaf kode yang anda masukkan salah..!!"<<endl<<endl;
}
getch();
}
Tidak ada komentar:
Posting Komentar