Program struktur data penjualan air minum



#include
#include
using namespace std;
main()
{
int data[6]= {5,3,2,1,6,4};
int cari,tmp,a,b;
int N=6;
int flag=0;
int AQ,CL,AQS,SW,CLB,AQC,H,U,K;
cout<<"|****************************************************************|\n";
cout<<"|PROGRAM PENCARIAN AIR MINERAL DI KAWASAN GUDANG INDUSTRI GRESIK |\n";
cout<<"|****************************************************************|\n\n";
cout<<" 1. Aqua Galon\n";
cout<<" 2. Cleo Galon\n";
cout<<" 3. Aquase Galon\n";
cout<<" 4. Swa Galon\n";
cout<<" 5. Club Galon\n";
cout<<" 6. Aquacui Galon\n\n\n\n";

for(a=0;a<6;a++)//Rumus Sorting
{
for(b=a+1;b<6;b++)
{
if(data[a]>=data[b])
{
tmp=data[a];
data[a]=data[b];
data[b]=tmp;
}
}
cout<<" "<<<" ";
}
cout<<"\n\n\nMasukkan Kode Barang Yang Anda Butuhkan : ";cin>>cari;
if(cari==1)
{
cout<<" Aqua Galon\n";
}
if(cari==2)
{
cout<<" Cleo Galon\n";
}
if(cari==3)
{
cout<<" Aquase Galon\n";
}
if(cari==4)
{
cout<<" Swa Galon\n";
}
if(cari==5)
{
cout<<" Club Galon\n";
}
if(cari==6)
{
cout<<" Aquacui Galon\n";
}



for(int a=0;a<6;a++)//Rumus Searching
{
if (data[a]==cari) flag=1;
}
if(flag==1)
{
cout<<"\nbarang ada\n\n\n";
}
else
{
cout<<"\nmaaf barang yang anda cari tidak ada!\n\n\n";
}
switch(cari)
{
case 1:
cout<<"Aqua galon\n";
cout<<"==========\n";
cout<<"Harga = Rp 11000\n";
cout<<"Anda mau beli berapa galon?=";cin>>AQ;
H=AQ*11000;
cout<<"jumlah harga = "<<<<"uang anda =";cin>>U;
if(U>H)
{
K=U-H;
cout<<"kembali ="<<<"Rupiah\n";
}
else if(U==H)
{
cout<<"Uang anda pas\n";
}
else
{
K=H-U;
cout<<"Uang anda kurang :"<<<"Rupiah"<<<"Cleo galon\n";
cout<<"==========\n";
cout<<"Harga = Rp 10000\n";
cout<<"Anda mau beli berapa galon?=";cin>>CL;
H=CL*10000;
cout<<"jumlah harga = "<<<<"uang anda =";cin>>U;
if(U>H)
{
K=U-H;
cout<<"kembali ="<<<"Rupiah\n";
}
else if(U==H)
{
cout<<"Uang anda pas\n";
}
else
{
K=H-U;
cout<<"Uang anda kurang :"<<<"Rupiah"<<<"Aquase galon\n";
cout<<"============\n";
cout<<"Harga = Rp 9000\n";
cout<<"Anda mau beli berapa galon?=";cin>>AQS;
H=AQS*9000;
cout<<"jumlah harga = "<<<<"uang anda =";cin>>U;
if(U>H)
{
K=U-H;
cout<<"kembali ="<<<"Rupiah\n";
}
else if(U==H)
{
cout<<"Uang anda pas\n";
}
else
{
K=H-U;
cout<<"Uang anda kurang :"<<<"Rupiah"<<<"Swa galon\n";
cout<<"=========\n";
cout<<"Harga = Rp 8000\n";
cout<<"Anda mau beli berapa galon?=";cin>>SW;
H=SW*8000;
cout<<"jumlah harga = "<<<<"uang anda =";cin>>U;
if(U>H)
{
K=U-H;
cout<<"kembali ="<<<"Rupiah\n";
}
else if(U==H)
{
cout<<"Uang anda pas\n";
}
else
{
K=H-U;
cout<<"Uang anda kurang :"<<<"Rupiah"<<<"Club galon\n";
cout<<"==========\n";
cout<<"Harga = Rp 8500\n";
cout<<"Anda mau beli berapa galon?=";cin>>CLB;
H=CLB*8500;
cout<<"jumlah harga = "<<<<"uang anda =";cin>>U;
if(U>H)
{
K=U-H;
cout<<"kembali ="<<<"Rupiah\n";
}
else if(U==H)
{
cout<<"Uang anda pas\n";
}
else
{
K=H-U;
cout<<"Uang anda kurang :"<<<"Rupiah"<<<"Aquacui galon\n";
cout<<"=============\n";
cout<<"Harga = Rp 8000\n";
cout<<"Anda mau beli berapa galon?=";cin>>AQC;
H=AQC*8000;
cout<<"jumlah harga = "<<<<"uang anda =";cin>>U;
if(U>H)
{
K=U-H;
cout<<"kembali ="<<<"Rupiah\n";
}
else if(U==H)
{
cout<<"Uang anda pas\n";
}
else
{
K=H-U;
cout<<"Uang anda kurang :"<<<"Rupiah"<<<"\n\n\nTerima Kasih\n";

}


BEGUNDELZ MANIAC. Diberdayakan oleh Blogger.

Amazon MP3 Clips