Home
Add Document
Sign In
Register
cout
Home
cout
1 #include #include using namespace std; int main() system("color a"); menu: int bangun,bangundatar,bangunru...
Author:
Harjanti Sugiarto
14 downloads
155 Views
58KB Size
Report
DOWNLOAD PDF
Recommend Documents
cout
sizeof(int); i++) { cout
Input dan Output. cout
INPUT OUTPUT. cout. Digunakan untuk mencetak suatu informasi ke layar Contoh : cout
TUTORIAL. Tabel Kebenaran Full Adder : Cin B A Sum Cout
Contoh Program C++ Sederhana. Script Program : #include #include main() { cout
my first program in C++ #include int main () { cout
Kód. Proměnné. #include using namespace std; int main(void) { cout
#include #include class basis { public : void info_basis() { cout
DAF'IAR ISI Th Intsnational Criminal Cout ; Developmelrt Ofkrtenrational taw Oleh: MadaApriandi Zuhir, SH, MCL Jrristituim
- JCI Network Directory: Aantal Directories maal effectieve kost is total. Le cout total = nombre de Directories commandé + Coût unitaire
By default, the standard output of a program is the screen, and the C++ stream object defined to access it is cout
#include
#include
using namespace std;
int main() {system("color a"); menu: int bangun,bangundatar,bangunruang; char ulang; cout<<"========================================================\n "; cout<<"\tMENGHITUNG BANGUN DATAR DAN BANGUN RUANG\n"; cout<<"========================================================\n "; cout<<"1. Bangun Datar\n"; cout<<"2. Bangun Ruang\n"; cout<<"Pilih bangun yang akan dihitung: ";cin>>bangun; switch(bangun) { case 1://BANGUN DATAR int klp,kll,kls,klla; cout<<"========================================================\n "; cout<<"1. Persegi\n"; cout<<"2. Lingkaran\n";
cout<<"3. Segitiga\n"; cout<<"4. Layang-layang\n"; cout<<"Pilih bangun yang akan dihitung: ";cin>>bangundatar; switch(bangundatar) { case 1://PERSEGI float sp,kp,lp; cout<<"========================================================\n "; cout<<"1. Keliling\n"; cout<<"2. Luas\n"; cout<<"Pilih yang akan dihitung: ";cin>>klp; switch(klp) { case 1: cout<<"========================================================\n "; cout<<"Keliling Persegi\n"; cout<<"========================================================\n "; cout<<"Masukkan sisi= ";cin>>sp; kp=4*sp; cout<<"Maka keliling persegi= "<
cout<<"========================================================\n "; cout<<"Luas persegi\n"; cout<<"========================================================\n "; cout<<"Masukkan sisi= ";cin>>lp; lp=sp*sp; cout<<"Maka luas persegi= "<
} break; case 2://LINGKARAN float dl,rl,kl,ll; cout<<"========================================================\n "; cout<<"1. Keliling\n"; cout<<"2. Luas\n"; cout<<"Pilih yang akan dihitung: ";cin>>klp; switch(kll) { case 1: cout<<"========================================================\n "; cout<<"Keliling lingkaran\n";
cout<<"========================================================\n "; cout<<"Masukkan diameter= ";cin>>dl; kl=3.14*dl; cout<<"Maka keliling lingkaran= "<
>klp; switch(klp)
{ case 1: cout<<"========================================================\n "; cout<<"Keliling segitiga\n"; cout<<"========================================================\n "; cout<<"Masukkan sisi 1= ";cin>>s1; cout<<"Masukkan sisi 2= ";cin>>s2; cout<<"Masukkan sisi 3= ";cin>>s3; ks=s1+s2+s3; cout<<"Maka keliling segitiga= "<
>klla; switch(klla) { case 1: cout<<"========================================================\n "; cout<<"Keliling Layang-layang\n"; cout<<"========================================================\n "; cout<<"Masukkan sisi 1= ";cin>>si1; cout<<"Masukkan sisi 2= ";cin>>si2; kla=(2*si1)+(2*si2); cout<<"Maka keliling persegi= "<
cout<<"========================================================\n "; cout<<"Masukkan diagonal 1= ";cin>>d1; cout<<"Masukkan diagonal 2= ";cin>>d2; lla=0.5*d1*d2; cout<<"Maka luas Layang-layang= "<
} } break; case 2://BANGUN RUANG int lvk,lvba,lvt,lvbo; cout<<"========================================================\n "; cout<<"1. Kubus\n"; cout<<"2. Balok\n"; cout<<"3. Tabung\n"; cout<<"4. Bola\n"; cout<<"Pilih bangun yang akan dihitung: ";cin>>bangunruang; switch(bangunruang) { case 1://KUBUS float rk,lpk,vk; cout<<"========================================================\n ";
cout<<"1. Luas permukaan\n"; cout<<"2. Volume\n"; cout<<"Pilih yang akan dihitung: ";cin>>lvk; switch(lvk) { case 1: cout<<"========================================================\n "; cout<<"Luas Permukaan Kubus\n"; cout<<"========================================================\n "; cout<<"Masukkan rusuk= ";cin>>rk; lpk=6*rk*rk; cout<<"Maka
luas
permukaan
kubus=
"<
>lvba; switch(lvba) { case 1: cout<<"========================================================\n "; cout<<"Luas Permukaan Balok\n"; cout<<"========================================================\n "; cout<<"Masukkan
panjang
balok=
";cin>>pba; cout<<"Masukkan lebar balok= ";cin>>lba; cout<<"Masukkan tinggi balok= ";cin>>tba; lpba=2*(pba*lba)+(pba*tba)+(lba*tba); cout<<"Maka "<
luas
permukaan
balok=
case 2: cout<<"========================================================\n "; cout<<"Volume Balok\n"; cout<<"========================================================\n "; cout<<"Masukkan
panjang
balok=
";cin>>pba; cout<<"Masukkan lebar balok= ";cin>>lba; cout<<"Masukkan tinggi balok= ";cin>>tba; vba=pba*lba*tba; cout<<"Maka volume balok= "<
>lvt; switch(lvt) { case 1:
cout<<"========================================================\n "; cout<<"Luas Permukaan Tabung\n"; cout<<"========================================================\n "; cout<<"Masukkan
jari-jari
tabung=
";cin>>rt; cout<<"Masukkan tinggi tabung= ";cin>>tt; lpt=2*3.14*rt*(rt+tt); cout<<"Maka
luas
permukaan
tabung=
"<
jari-jari
tabung=
";cin>>rt; cout<<"Masukkan tinggi tabung= ";cin>>tt; vt=3.14*rt*rt*tt; cout<<"Maka volume tabung= "<
float rbo,lpbo,vbo; cout<<"========================================================\n "; cout<<"1. Luas Permukaan\n"; cout<<"2. Volume\n"; cout<<"Pilih yang akan dihitung: ";cin>>lvbo; switch(lvbo) { case 1: cout<<"========================================================\n "; cout<<"Luas Permukaan Bola\n"; cout<<"========================================================\n "; cout<<"Masukkan jari-jari= ";cin>>rbo; lpbo=4*3.14*rbo*rbo; cout<<"Maka
luas
permukaan
bola=
"<
cout<<"Masukkan jari-jari bola= ";cin>>rbo; vbo=1.33*3.14*rbo*rbo; cout<<"Maka volume bola= "<
} } } cout<<"\n---------------------------------------------------------\n"; cout<<"Apakah Anda ingin mengulang?(Y/T)";cin>>ulang; cout<<endl; switch(ulang) { case 'Y': goto menu; break; case 'y': goto menu; break; case 'T': break; case 't': break; default: cout<<"Masukkan salah\n"; cout<<"Apakah Anda ingin mengulang?(Y/T)";cin>>ulang;
cout<<endl; goto menu; } }
×
Report "cout"
Your name
Email
Reason
-Select Reason-
Pornographic
Defamatory
Illegal/Unlawful
Spam
Other Terms Of Service Violation
File a copyright complaint
Description
×
Sign In
Email
Password
Remember me
Forgot password?
Sign In
Our partners will collect data and use cookies for ad personalization and measurement.
Learn how we and our ad partner Google, collect and use data
.
Agree & close