#include <iostream.h>
#include <conio.h>
#include <math.h>
void main ()
{
int pilihan;
double t_12110970, r_12110970, s_12110970, p_12110970, l_12110970, sm_12110970, sisi_12110970;
float lk_12110970, vk_12110970, luas_ls4_12110970, volume_ls4_12110970, lb_12110970, vb_12110970;
do{
clrscr();
cout<<"-----------------------------";
cout<<endl;
cout<<"Pilihan hitung: "<<endl;
cout<<"1. Luas kerucut"<<endl;
cout<<"2. Volume kerucut"<<endl;
cout<<"3. Luas limas segi4"<<endl;
cout<<"4. Volume luas segi4"<<endl;
cout<<"5. Luas bola"<<endl;
cout<<"6. Volume bola"<<endl;
cout<<"7. Keluar"<<endl;
cout<<"-----------------------------";
cout<<endl;
cout<<"pilih : 1..7 = " ;cin>>pilihan;
switch(pilihan){
case 1 : cout<<"masukan tinggi : ";cin>>t_12110970;
cout<<"masukan jari jari : ";cin>>r_12110970;
sm_12110970=sqrt(r_12110970*r_12110970+t_12110970*t_12110970);
lk_12110970=3.14*r_12110970*(r_12110970+sm_12110970);
cout<<"sisi miring = "<<sm_12110970<<endl;
cout<<"LUAS KERUCUT = "<<lk_12110970<<endl;
cout<<endl;
cout<<"Pres any key to back!!!"<<endl;
getch();
break;
case 2 : cout<<"masukan tinggi : ";cin>>t_12110970;
cout<<"masukan jari jari : ";cin>>r_12110970;
vk_12110970=0.33*3.14*r_12110970*r_12110970*t_12110970;
cout<<"VOLUME KERUCUT = "<<vk_12110970<<endl;
cout<<endl;
cout<<"Pres any key to back!!!"<<endl;
getch();
break;
case 3 : cout<<"masukan tinggi : ";cin>>t_12110970;
cout<<"masukan sisi : ";cin>>sisi_12110970;
sm_12110970=sqrt ((sisi_12110970*0.5)*(sisi_12110970*0.5)+(t_12110970*t_12110970));
luas_ls4_12110970=sisi_12110970*sisi_12110970+(4*sisi_12110970*0.5*sm_12110970);
cout<<"sisi miring = "<<sm_12110970<<endl;
cout<<"LUAS LIMAS SEGI 4 = "<<luas_ls4_12110970<<endl;
cout<<endl;
cout<<"Pres any key to back!!!"<<endl;
getch();
break;
case 4 : cout<<"masukan tinggi : ";cin>>t_12110970;
cout<<"masukan sisi : ";cin>>sisi_12110970;
volume_ls4_12110970=0.33*sisi_12110970*sisi_12110970*t_12110970;
cout<<"VOLUME LIMAS SEGI 4 = "<<volume_ls4_12110970<<endl;
cout<<endl;
cout<<"Pres any key to back!!!"<<endl;
getch();
break;
case 5 : cout<<"masukan jari jari : ";cin>>r_12110970;
lb_12110970=4*3.14*r_12110970*r_12110970;
cout<<"LUAS BOLA = "<<lb_12110970<<endl;
cout<<endl;
cout<<"Pres any key to back!!!"<<endl;
getch();
break;
case 6 : cout<<"masukan jari jari : ";cin>>r_12110970;
vb_12110970=1.33*3.14*r_12110970*r_12110970*r_12110970;
cout<<"VOLUME BOLA = "<<vb_12110970<<endl;
cout<<endl;
cout<<"Pres any key to back!!!"<<endl;
getch();
break;
}
getch();
}
while (pilihan !=7);
}
Posting Komentar