RSS

Pemrograman pembayaran Warnet

09 Okt

#include
#include
#include
main()
{
char nm[20],plg,*ket,lagi;
int hrg,lama,pot,total,ubay,ukem;
atas:
cout<<"masukan Nama anda : ";gets(nm);
cout<>plg;
if(plg=’p’)
{ket=”pelanggan”;
hrg=4000;}
else
{ket=”umum”;
hrg=5000;}
cout<>lama;
if(lama>=5)
{pot=0.5*hrg;}
else if(lama>=3)
{pot=0.3*hrg;}
else
{pot=0;}
clrscr();

/*layar keluaran*/
cout<<"\t WARNET GAULL "<<endl;
cout<<"==========================="<<endl<<endl;
cout<<"Nama Penggujung :"<<nm<<endl;
cout<<"keterangan :"<<ket<<endl;
cout<<"Potongan Harga :"<<pot<<endl;
total=(hrg*lama)-pot;
cout<<"Total Pembayaran:"<<total<<endl<<endl;
cout<<"==========================="<<endl<<endl;
cout<>ubay;
ukem=ubay-total;
cout<<"Uang Kembai :"<<ukem<<endl;
cout<<"=========================="<<endl<<endl;
cout<<"TERIMA KASIH ATAS KUNJUNGAN ANDA"<<endl<<endl;
cout<>lagi;
if(lagi==’Y’ || lagi==’y’)
{goto atas;}
else
{goto akhir;}
akhir:
getch();
}

 
Tinggalkan komentar

Ditulis oleh pada Oktober 9, 2012 in Contoh program C++

 

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

 
%d blogger menyukai ini: