Monday, 2 April 2012
Mengingat Tugas UAS
#include <conio.h>
#include <iostream.h>
#include <math.h>
#include <stdio.h>
void limas_12111009(){
double sm_12111009, v_12111009, p_12111009, t_12111009, l_12111009, lp_12111009, la_12111009;
cout<<"Masukkan Panjang Permukaan Limas : ";cin>>p_12111009;
cout<<"Masukkan Tinggi Limas : ";cin>>t_12111009;
cout<<"Masukkan lebar Permukaan Limas : ";cin>>l_12111009;
cout<<"\n-----------------Hasil-----------------"<<endl<<endl;
sm_12111009=sqrt(t_12111009*t_12111009*+(p_12111009/2)*(p_12111009/2));
cout<<"Sisi Miring Limas : "<<sm_12111009<<endl;
la_12111009=(3*sqrt(3)/2)*t_12111009*t_12111009;
cout<<"Luas Alas Limas Segi Enam : "<<la_12111009<<endl;
lp_12111009=la_12111009+(((l_12111009*t_12111009)/2)*6);
cout<<"Luas Limas Segi Enam : "<<lp_12111009<<endl;
v_12111009=la_12111009*t_12111009*0.33;
cout<<"Volume Limas Segi Enam : "<<v_12111009<<endl;
}
void prisma_12111009(){
double v_12111009, la_12111009, t_12111009, k_12111009, s_12111009, l_12111009;
cout<<"Masukkan Sisi Prisma Segi Enama : ";cin>>s_12111009;
cout<<"Masukkan Tinggi Prisma : ";cin>>t_12111009;
cout<<"\n-----------------Hasil-----------------"<<endl<<endl;
cout<<"Sisi Miring = Sisi Prisma : "<<s_12111009<<endl;
v_12111009=((3*sqrt(3)*s_12111009*s_12111009)/2)*t_12111009;
cout<<"Volume Prisma Segi Enam : "<<v_12111009<<endl;
l_12111009=2*((3*sqrt(3)*s_12111009*s_12111009)/2)+6*s_12111009*t_12111009;
cout<<"Luas Prisma Segi Enam : "<<l_12111009<<endl;
}
void trapesium_12111009(){
double a_12111009, b_12111009, t_12111009, l_12111009, v_12111009, s_12111009, tp_12111009;
cout<<" a "<<endl;
cout<<" ___________ "<<endl;
cout<<" /| ; "<<endl;
cout<<" / |t ; "<<endl;
cout<<" / | ; "<<endl;
cout<<" ----------------- "<<endl;
cout<<" b"<<endl<<endl<<endl;
cout<<"Masukkan Tinggi Trapesium : ";cin>>t_12111009;
cout<<"Masukkan Panjang a : ";cin>>a_12111009;
cout<<"Masukkan Panjang b : ";cin>>b_12111009;
cout<<"Masukkan Tinggri Prisma Trapesium : ";cin>>tp_12111009;
cout<<"\n-----------------Hasil------------------"<<endl<<endl;
cout<<"\n\n "<<a_12111009<<endl;
cout<<" ___________ "<<endl;
cout<<" /| ; "<<endl;
cout<<" / |"<<t_12111009<<" ; "<<endl;
cout<<" / | ; "<<endl;
cout<<" ----------------- "<<endl;
cout<<" "<<b_12111009<<endl<<endl;
s_12111009=sqrt((b_12111009-a_12111009)/2)*((b_12111009-a_12111009)/2)+t_12111009+t_12111009;
cout<<"Sisi Miring Trapesium : "<<s_12111009<<endl;
l_12111009=(2*0.5*(a_12111009+b_12111009)*t_12111009)+((a_12111009+s_12111009+b_12111009+s_12111009)*tp_12111009);
cout<<"Luas Prisma Trapesium : "<<l_12111009<<endl;
v_12111009=0.5*(a_12111009+b_12111009)*t_12111009*tp_12111009;
cout<<"Volume Prisma Segi Enam : "<<v_12111009<<endl;
}
void bola_12111009(){
double r_12111009, l_12111009, v_12111009;
cout<<"Masukkan Jari-jari bola : ";cin>>r_12111009;
cout<<"\n--------Hasil--------"<<endl<<endl;
l_12111009=4*3.14*r_12111009*r_12111009;
cout<<"Luas Bola : "<<l_12111009<<endl;
v_12111009=1.33*3.14*r_12111009*r_12111009*r_12111009;
cout<<"Volume Bola : "<<v_12111009<<endl;
}
void tabung_12111009(){
double r_12111009, t_12111009, l_12111009, v_12111009;
cout<<"Masukkan Jari-jari tabung : ";cin>>r_12111009;
cout<<"Masukkan Tinggi : ";cin>>t_12111009;
cout<<"\n--------Hasil--------"<<endl<<endl;
l_12111009=2*3.14*r_12111009*(r_12111009+t_12111009);
cout<<"Luas Tabung : "<<l_12111009<<endl;
v_12111009=3.14*r_12111009*r_12111009*t_12111009;
cout<<"Volume Tabung : "<<v_12111009<<endl;
}
void celcius_12111009(){
double c_12111009, r_12111009, f_12111009;
cout<<"Masukkan Suhu Celcius : ";cin>>c_12111009;
cout<<"\n-----------Hasil-----------"<<endl<<endl;
r_12111009=c_12111009*0.8;
cout<<"Celcius ke Reamur : "<<r_12111009<<endl;
f_12111009=(c_12111009*1,8)+32;
cout<<"Celcius ke Fahrenhait : "<<f_12111009<<endl;
}
void reamur_12111009(){
double c_12111009, r_12111009, f_12111009;
cout<<"Masukkan Suhu Reamur : ";cin>>r_12111009;
cout<<"\n-----------Hasil-----------"<<endl<<endl;
c_12111009=r_12111009*1.25;
cout<<"Reamur ke Celcius : "<<c_12111009<<endl;
f_12111009=(r_12111009*2.25)+32;
cout<<"Reamur ke Fahrenhait : "<<f_12111009<<endl;
}
void fahrenhait_12111009(){
double c_12111009, r_12111009, f_12111009;
cout<<"Masukkan Suhu Fahrenhait : ";cin>>f_12111009;
cout<<"\n-----------Hasil-----------"<<endl<<endl;
c_12111009=(c_12111009-32)/1,8;
cout<<"Fahrenhait ke Celcius : "<<c_12111009<<endl;
r_12111009=(f_12111009-32)/2.25;
cout<<"Fahrenhait ke Reamur : "<<r_12111009<<endl;
}
void rk_12111009(){
double r_12111009, k_12111009;
cout<<"Masukkan Suhu Reamur : ";cin>>r_12111009;
cout<<"\n-----------Hasil-----------"<<endl<<endl;
k_12111009=r_12111009/0.8+273.15;
cout<<"Reamur ke Kelvin : "<<k_12111009<<endl;
}
void kr_12111009(){
double k_12111009, r_12111009;
cout<<"Masukkan Suhu Kelvin : ";cin>>k_12111009;
cout<<"-----------Hasil-----------"<<endl<<endl;
r_12111009=(k_12111009-273.15)*0.8;
cout<<"Kelvin ke Reamur : "<<r_12111009<<endl;
}
void main(){
double l_12111009, r_12111009, v_12111009, t_12111009, ce_12111009, re_12111009, fa_12111009, ke_12111009;
int menu1_12111009, mainmenu_12111009, menu2_12111009;
mainmenu_12111009=1;
while(mainmenu_12111009!=3){
cout<<"---Aplikasi Menu Utama---"<<endl<<endl;
cout<<"1 = Bangun Ruang"<<endl;
cout<<"2 = Konversi Suhu"<<endl;
cout<<"3 = Keluar"<<endl<<endl<<endl;
cout<<"Pilih Menu : ";cin>>mainmenu_12111009;
clrscr();
switch(mainmenu_12111009){
case 1:
menu1_12111009=1;
while(menu1_12111009<6){
cout<<"Menu Bangun Ruang : "<<endl<<endl;
cout<<"1 = Menghitung Sisi Miring, Luas & Volume Limas Segi Enam"<<endl;
cout<<"2 = Menghitung Sisi Miring, Luas & Volume Prisma Segi Enam"<<endl;
cout<<"3 = Menghitung Sisi Miring, Luas & Volume Prisma Trapesium Sama Sisi"<<endl;
cout<<"4 = Menghitung Luas & Volume Bola"<<endl;
cout<<"5 = Menghitung Luas & Volume Tabung"<<endl;
cout<<"6 = Kembali Ke Menu Utama"<<endl<<endl<<endl;
cout<<"Pilih Menu : ";cin>>menu1_12111009;
clrscr();
switch (menu1_12111009){
case 1:
limas_12111009();
getch();
clrscr();
break;
case 2:
prisma_12111009();
getch();
clrscr();
break;
case 3:
trapesium_12111009();
getch();
clrscr();
break;
case 4:
bola_12111009();
getch();
clrscr();
break;
case 5:
tabung_12111009();
getch();
clrscr();
break;
case 6:
clrscr();
break;
default :
cout<<"\nKode menu salah"<<endl;
getch();
clrscr();
}}
break;
case 2:
menu2_12111009=1;
while(menu2_12111009<6){
cout<<"Menu Konversi Suhu"<<endl<<endl;
cout<<"1 = Konversi Celcius ke Reamur & Fahrenhait"<<endl;
cout<<"2 = Konversi Reamur ke Celcius & Fahrenhait"<<endl;
cout<<"3 = Konversi Fahrenhait ke Celcius & Reamur"<<endl;
cout<<"4 = Konversi Reamur ke Kelvin"<<endl;
cout<<"5 = Konversi Kelvin ke Reamur"<<endl;
cout<<"6 = Kembali Ke Menu Utama"<<endl<<endl<<endl;
cout<<"Pilih Menu Suhu : ";cin>>menu2_12111009;
clrscr();
switch (menu2_12111009){
case 1:
celcius_12111009();
getch();
clrscr();
break;
case 2:
reamur_12111009();
getch();
clrscr();
break;
case 3:
fahrenhait_12111009();
getch();
clrscr();
break;
case 4:
rk_12111009();
getch();
clrscr();
break;
case 5:
kr_12111009();
getch();
clrscr();
break;
case 6:
clrscr();
break;
default :
cout<<"\nKode menu salah"<<endl;
getch();
clrscr();
}}
break;
default :
clrscr();
}}
cout<<"\nBye..."<<endl;
getch();
}
Subscribe to:
Post Comments (Atom)
NIM-nya banyak banget kan???
ReplyDelete