#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{
awal:
clrscr();
char nama[15],kode,ukuran,merk[15],lagi;
long harga=0,jml=0,diskon=0,total=0,totaldiskon=0,ppn=0,a=0,totalbayar=0,uangbayar=0,uangkembali=0;
clrscr();
cout<<"\nDISTRO BAJU\t\t\t ";
cout<<"\n---------------------------";
cout<<"\nNama Kasir : ";cin>>nama;
cout<<"Kode Baju : ";cin>>kode;
cout<<"Ukuran : ";cin>>ukuran;
cout<<"Jumlah : ";cin>>jml;
if (kode=='1')
{
strcpy(merk,"H & R");
if (ukuran=='S' || ukuran =='s')
harga=50000;
else if (ukuran=='M' || ukuran =='m')
harga=75000;
else if (ukuran=='L' || ukuran =='l')
harga=100000;
}
else if (kode=='2')
{
strcpy(merk,"ADIDAS");
if (ukuran=='S' || ukuran =='s')
harga=100000;
else if (ukuran=='M' || ukuran =='m')
harga=75000;
else if (ukuran=='L' || ukuran =='l')
harga=100000;
}
else if (kode=='3')
{
strcpy(merk,"NIKE");
if (ukuran=='S' || ukuran =='s')
harga=100000;
else if (ukuran=='M' || ukuran =='m')
harga=125000;
else if (ukuran=='L' || ukuran =='l')
harga=150000;
}
else
cout<<"Salah Kode Baju"<<endl;
cout<<"\n------------------------"<<endl;
cout<<"nama : "<<nama<<endl;
cout<<"Merk Baju : "<<merk<<endl;
cout<<"Harga Baju : "<<harga<<endl;
cout<<"Jumlah Beli : "<<jml<<endl;
total=jml*harga;
cout<<"Total Beli : "<<total<<endl;
if(jml>=60) {
diskon=0.05*total;
}
cout<<"Diskon : "<<diskon<<endl;
totaldiskon=total-diskon;
cout<<"Total - Diskon : "<<totaldiskon<<endl;
a=0.10*totaldiskon;
ppn=a+totaldiskon;
cout<<"Ditambah PPN 10% : "<<ppn<<endl;
cout<<"\n------------------------"<<endl;
cout<<"Uang Bayar : ";cin>>uangbayar;
uangkembali=uangbayar-ppn;
cout<<"Uang Kembali : "<<uangkembali<<endl;
cout<<"\n\t\t INGIN INPUT LAGI [Y/T] : ";cin>>lagi;
if(lagi=='Y'||lagi=='y')
goto awal;
getch();
}
Tidak ada komentar:
Posting Komentar