Quis C++ Membuat Program TOKO BUSANA
Membuat Program C++ TOKO BUSANA - Pertama kalinya mengerjakan Quis C++ dengan ketentuan yang susah :D , karna banyak pilihan ukuran serta harga dan diskon .
Hasil Quis C++ Membuat Program TOKO BUSANA
TAMPILAN INPUT TOKO BUSANA
TAMPILAN OUTPUT TOKO BUSANA
Script Borlan Quis C++ Membuat Program TOKO BUSANA
/*—————————————————————*/
/* Quis C++ Membuat Program TOKO BUSANA */
/*—————————————————————*/
#main()
{
char kd[5],uk[5],jenis[20],nama[70],alamat[50];
int hrg,jumlah,sub;
float total,diskon;
cout<<"\tTOKO BUSANA "<<endl;
cout<<" ================================================="<<endl;
cout<<" Masukan Nama Pembeli : ";cin>>nama;
cout<<" Masukan Alamat Pengiriman : ";cin>>alamat;
cout<<""<<endl;
cout<<" Masukan Kode Jenis Pakaian [T/K/J]: ";cin>>kd;
cout<<" Masukan Ukuran [S/M/L]: ";cin>>uk;
cout<<" Jumlah pembelian : ";cin>>jumlah;
if(!strcmp(kd,"T")||!strcmp(kd,"t"))
{
strcpy(jenis,"T-Shirt");
if (!strcmp(uk,"S")||!strcmp(uk,"s"))
{
hrg=25000;
}
else if (!strcmp(uk,"M")||!strcmp(uk,"m"))
{
hrg=45000;
}
else
{
hrg=0;
}
}
else if(!strcmp(kd,"K")||!strcmp(kd,"k"))
{
strcpy(jenis,"Kemeja");
if (!strcmp(uk,"S")||!strcmp(uk,"s"))
{
hrg=40000;
}
else if (!strcmp(uk,"M")||!strcmp(uk,"m"))
{
hrg=45000;
}
else if (!strcmp(uk,"L")||!strcmp(uk,"l"))
{
hrg=50000;
}
else
{
hrg=0;
}
}
else if(!strcmp(kd,"J")||!strcmp(kd,"j"))
{
strcpy(jenis,"Kemeja");
if (!strcmp(uk,"S")||!strcmp(uk,"s"))
{
hrg=65000;
}
else if (!strcmp(uk,"M")||!strcmp(uk,"m"))
{
hrg=75000;
}
else if (!strcmp(uk,"L")||!strcmp(uk,"l"))
{
hrg=80000;
}
else
{
hrg=0;
}
}
else
{
strcpy(jenis,"Salah Memasukan Jenis Pakaian");
}
sub=jumlah*hrg;
if(sub>=200000)
{
diskon=sub*0.2;
}
else if (sub>=100000)
{
diskon=sub*0.1;
}
else if (sub<100000)
{
diskon=0;
}
total=sub-diskon;
clrscr();
cout<<"\STRUKTUR BELANJA TOKO BUSANA "<<endl;
cout<<"==================================="<<endl;
cout<<"Nama Pembeli :"<<nama<<endl;
cout<<"Alamat Pengiriman :"<<alamat<<endl;
cout<<""<<endl;
cout<<"Jenis Pakaian :"<<jenis<<endl;
cout<<"Ukuran :"<<uk<<endl;
cout<<"Harga :"<<hrg<<endl;
cout<<"Jumlah Pembelian :"<<jumlah<<endl;
cout<<"Diskon :"<<diskon<<endl;
cout<<"Total :"<<total<<endl;
cout<<"==================================="<<endl;
cout<<"\tTERIMA KASIH"<<endl;
getch();
}