Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
301Activity
0 of .
Results for:
No results containing your search query
P. 1
Contoh Program C++ (Harga Tiket)

Contoh Program C++ (Harga Tiket)

Ratings:

5.0

(1)
|Views: 19,683 |Likes:
Published by neike25

More info:

Published by: neike25 on May 17, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/03/2013

pdf

text

original

 
Contoh Program Tiket Pesawat dalam Bahasa C++#include<iostream.h>#include<conio.h>#include<stdio.h>main(){char kode_kota,kelas,kembali;int harga_tiket, PPN, jum_bayar;do{clrscr();textcolor(13);cprintf("\n^^^^^^^^^^^^^HARGA TIKET PESAWAT^^^^^^^^^^^^^^\n");cout<<"\n==================================================\n";cout<<"Tujuan Anda Kelas Kelas Kelas\n";cout<<" Ekonomi(E) Bisnis(B) Ekskutif(X)\n";cout<<"==================================================\n";cout<<"1. Bangkok $35 $45 $55\n";cout<<"2. Hongkong $45 $55 $65\n";cout<<"==================================================\n";textcolor(30);cprintf("\n^^___ Pilih Kota Tujuan___ ^^");cout<<"\nmasukan kode kota [1..2] :" ;cin>>kode_kota;switch(kode_kota){case '1':{cout<<"Kota Tujuan Anda : BANGKOK\n"<<endl;textcolor(30);cprintf("^^___Pilih Kelas Pesawat___^^");cout<<"\nmasukan kode kelas [E/B/X]:";cin>>kelas;cout<<endl;if(kelas=='E' || kelas=='e'){harga_tiket=35*5675;PPN=0;jum_bayar=harga_tiket-PPN;cout<<"Harga Tiket = Rp."<<harga_tiket<<endl;cout<<"PPN = Rp."<<PPN<<endl;cout<<"jumlah bayar = Rp."<<jum_bayar<<endl;}else if(kelas=='B' || kelas=='b'){harga_tiket=45*5675;PPN=0;jum_bayar=harga_tiket-PPN;cout<<"Harga Tiket = Rp."<<harga_tiket<<endl;cout<<"PPN = Rp."<<PPN<<endl;cout<<"jumlah bayar = Rp."<<jum_bayar<<endl;}else if(kelas=='X' || kelas=='x'){
 
harga_tiket=55*5675;PPN=0.05*harga_tiket;jum_bayar=harga_tiket-PPN;cout<<"Harga Tiket = Rp."<<harga_tiket<<endl;cout<<"PPN = Rp."<<PPN<<endl;cout<<"jumlah bayar = Rp."<<jum_bayar<<endl;}break;}case'2':{cout<<"Kota Tujuan Anda : HONGKONG\n"<<endl;textcolor(30);cprintf("^^___Pilih Kelas Pesawat___^^");cout<<"\nmasukan kode kelas [E/B/X]:";cin>>kelas;cout<<endl;if(kelas=='E' || kelas=='e'){harga_tiket=45*7215;PPN=0;jum_bayar=harga_tiket-PPN;cout<<"Harga Tiket = Rp."<<harga_tiket<<endl;cout<<"PPN = Rp."<<PPN<<endl;cout<<"jumlah bayar = Rp."<<jum_bayar<<endl;}else if(kelas=='B' || kelas=='b'){harga_tiket=55*7215;PPN=0.05*harga_tiket;jum_bayar=harga_tiket-PPN;cout<<"Harga Tiket = Rp."<<harga_tiket<<endl;cout<<"PPN = Rp."<<PPN<<endl;cout<<"jumlah bayar = Rp."<<jum_bayar<<endl;}else if(kelas=='X' || kelas=='x'){harga_tiket=65*7215;PPN=0.05*harga_tiket;jum_bayar=harga_tiket-PPN;cout<<"Harga Tiket =Rp.<<harga_tiket<<endl;cout<<"PPN = Rp."<<PPN<<endl;cout<<"jumlah bayar =Rp."<<jum_bayar<<endl;}break;}default :cout<<"Anda salah memasukan kode"<<endl;}textcolor(60);cprintf("\nAnda ingin kembali [y/t] :");cin>>kembali;}while(kembali=='Y' || kembali=='y');getch();}
 
 
Tampilan awal program ketika di runing :Gbr1Ketika dimasukan kode kota 1 maka akan keluar nama kota tujuan, seperti tampilandibawah ini :Gbr2

Activity (301)

You've already reviewed this. Edit your review.
Anisa Nurlipah liked this
Machrus Ehe liked this
Zet D. Zii liked this
Stenly Maramis liked this
gimana caranya kalo disuruh membuat program yang inputnya berupa angka, tetapi ketika input yang dimasukkan bukan angka outputnya "masukan harus berupa angka" ? anybody can help me?
Set Nha liked this
Amirul Fadzil liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->