#include <conio.h>
#include <stdio.h>
#include <iostream.h>
main()
{
int i,jd,uk,jmlah,total,harga;
char mc,lagi,enter;
atas:
clrscr();
cout<<"\t\tMAJU MAKMUR"<<endl;
cout<<"\t\Pusat Penjualan Cat Tembok"<<endl;
cout<<"....................................."<<endl;
cout<<"\A. ICI Dulux"<<endl;
cout<< "1. Ukuran Kecil => Rp. 15000\n";
cout<< "2. Ukuran Sedang => Rp. 20000\n";
cout<< "3. Ukuran Besar => Rp. 25000\n";
cout<<"\nB. Movilex VIP"<<endl;
cout<< "1. Ukuran Kecil => Rp. 13500\n";
cout<< "2. Ukuran Sedang => Rp. 17500\n";
cout<< "3. Ukuran Besar => Rp. 20000\n";
cout<<"\nC. Jotun Strax"<<endl;
cout<< "1. Ukuran Kecil => Rp. 15000\n";
cout<< "2. Ukuran Sedang => Rp. 18500\n";
cout<< "3. Ukuran Besar => Rp. 22000\n";
cout<<"............................................."<<endl;
cout<<"Input Jumlah Data : ";cin>>jd;
for (i=1;i<=jd;i++)
{
cout<<"............................................."<<endl;
cout<<"Pilih Merek Cat [A/B/C] : ";cin>>mc;
cout<<"Pilih Ukuran Kaleng [1/2/3] : ";cin>>uk;
if (mc=='A'||mc=='a')
switch(uk)
{
case 1:harga=15000;break;
case 2:harga=20000;break;
case 3:harga=25000;break;
default:harga=0;break;
}
else if (mc=='B'||mc=='b')
switch(uk)
{
case 1:harga=13500;break;
case 2:harga=17500;break;
case 3:harga=20000;break;
default:harga=0;break;
}
else if(mc=='C'||mc=='c')
switch(uk)
{
case 1:harga=15000;break;
case 2:harga=18500;break;
case 3:harga=22000;break;
default:harga=0;break;
}
else
{cout<<"\nAnda salah memasukan kode cat (GUNAKAN HURUF KAPITAL)";
cout<<"\nTEKAN (B) LALU ENTER UNTUK KEMBALI MENGHITUNG : ";cin>>enter;
if(enter=='B'||enter=='b')
goto atas;
else
cout<<"\tDATA EROR";
goto bawah;}
cout<<"Harga Satuan Barang : Rp."<<harga<<endl;
cout<<"Jumlah Yang dibeli : ";cin>>jmlah;
total=(harga*jmlah);
cout<<"Harga yang harus dibayar : Rp."<<total<<endl;
cout<<"............................................."<<endl;
}
cout<<"Ingin Hitung Lagi [Y/N] : ";cin>>lagi;
if (lagi=='Y'||lagi=='y')
goto atas;
else
cout<<"\n TERIMA KASIH BANYAK "<<endl;
bawah:
getch();
}
Terima kasih semoga bermanfaat....
nb. usahakan jangan copas langsung di boorland tapi di ketik,,,
0 komentar:
Posting Komentar