Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<conio.h>
- #include<iostream.h>
- #include<stdio.h>
- #include<iomanip.h>
- class baju
- {
- public:
- char koju[5][3],koran[5],naju[5][30];
- int jumsew[5];
- long int harga[5],subtotal[5];
- };baju sewa;
- judul()
- {
- cout<<"\t\t\t PENYEWAAN PAKAIAN ADAT NASIONAL"<<endl;
- cout<<"\t\t\t GANTENG CANTIK BOUTIQUE"<<endl;
- cout<<"\t\t\t * * * * * * * * * * * * * * * *"<<endl;
- return 0;
- }
- main()
- {
- //mendeklarasikan nama sewa menggunakan tipe dari class baju
- char lagi,napen[20];
- int b,lama,i,data,pilih;
- long int tobay,ubay,ukem;
- menuutama:
- //tobay=0;
- clrscr();
- judul();
- cout<<"Selamat Datang Di Ganteng Cantik Botique"<<endl;
- cout<<endl;
- cout<<"Pilihan Menu : "<<endl;
- cout<<"1. Input Data"<<endl;
- cout<<"2. Log Out"<<endl;
- cout<<"========================================="<<endl;
- cout<<"Inputkan Pilihan Anda : ";cin>>pilih;
- if(pilih==1)
- {
- goto input;
- }
- else if(pilih==2)
- {
- goto keluar;
- }
- else
- {
- goto menuutama;
- }
- //cout<<"\n\n";
- input:
- tobay=0;
- clrscr();
- judul();
- cout<<"Nama Penyewa : ";gets(napen);
- cout<<"Lama Sewa : ";cin>>lama;
- cout<<"Jumlah Data : ";cin>>data;
- cout<<endl<<endl;
- cout<<"\t\t\t * * * * * * * * * * * * * * * *"<<endl;
- cout<<endl;
- for(i=1;i<=data;i++)
- {
- cout<<"Data ke - "<<i<<endl;
- ulang:
- cout<<"Kode Paket Baju [JB/JT/SB] : ";cin>>sewa.koju[i];
- cout<<"Kode Ukuran Baju [S/M/L] : ";cin>>sewa.koran[i];
- if(strcmp(sewa.koju[i],"JB")==0||strcmp(sewa.koju[i],"jb")==0)
- {
- strcpy(sewa.naju[i],"JAWA BARAT");
- if(sewa.koran[i]=='S'||sewa.koran[i]=='s')
- sewa.harga[i]=200000;
- else if(sewa.koran[i]=='M'||sewa.koran[i]=='m')
- sewa.harga[i]=225000;
- else if(sewa.koran[i]=='L'||sewa.koran[i]=='l')
- sewa.harga[i]=250000;
- else
- {
- sewa.harga[i]=0;
- goto ulang;
- }
- }
- else if(strcmp(sewa.koju[i],"JT")==0||strcmp(sewa.koju[i],"jt")==0)
- {
- strcpy(sewa.naju[i],"JAWA TENGAH");
- if(sewa.koran[i]=='S'||sewa.koran[i]=='s')
- sewa.harga[i]=225000;
- else if(sewa.koran[i]=='M'||sewa.koran[i]=='m')
- sewa.harga[i]=255000;
- else if(sewa.koran[i]=='L'||sewa.koran[i]=='l')
- sewa.harga[i]=275000;
- else
- {
- sewa.harga[i]=0;
- goto ulang;
- }
- }
- else if(strcmp(sewa.koju[i],"SB")==0||strcmp(sewa.koju[i],"sb")==0)
- {
- strcpy(sewa.naju[i],"SUMATERA BARAT");
- if(sewa.koran[i]=='S'||sewa.koran[i]=='s')
- sewa.harga[i]=260000;
- else if(sewa.koran[i]=='M'||sewa.koran[i]=='m')
- sewa.harga[i]=265000;
- else if(sewa.koran[i]=='L'||sewa.koran[i]=='l')
- sewa.harga[i]=300000;
- else
- {
- sewa.harga[i]=0;
- goto ulang;
- }
- }
- else
- {
- goto ulang;
- }
- cout<<"jumlah Sewa : ";cin>>sewa.jumsew[i];
- sewa.subtotal[i]=sewa.harga[i]*sewa.jumsew[i];
- tobay=tobay+sewa.subtotal[i];
- cout<<endl;
- }
- //ini proses outputnya
- clrscr();
- cout<<"\t\t\t STRUK PENYEWAAN PAKAIAN ADAT"<<endl;
- judul();
- cout<<endl<<endl;
- cout<<"Nama Penyewa : "<<napen<<endl;
- cout<<endl;
- // 12345678901234567890123456789012345678901234567890123456789012345678901234567890
- // 1 2 3 4 5 6 7
- cout<<"Data Baju Yang Disewa"<<endl;
- cout<<"************************************************************************"<<endl;
- cout<<"No. Nama Paket Harga Jumlah Sewa Subtotal"<<endl;
- cout<<"************************************************************************"<<endl;
- b=14;
- for(i=1;i<=data;i++)
- {
- gotoxy(1,b);cout<<i;
- gotoxy(6,b);cout<<sewa.naju[i];
- gotoxy(24,b);cout<<sewa.harga[i];
- gotoxy(40,b);cout<<sewa.jumsew[i];
- gotoxy(53,b);cout<<sewa.subtotal[i];
- b++;
- }
- cout<<"\n************************************************************************"<<endl;
- cout<<"\n TOTAL BAYAR : Rp. "<<tobay<<endl;
- cout<<" UANG BAYAR : Rp. ";cin>>ubay;
- ukem=ubay-tobay;
- cout<<" UANG KEMBALI : Rp. "<<ukem<<endl;
- cout<<" TERIMA KASIH"<<endl;
- cout<<"Input Data Lagi [Y/T] : ";cin>>lagi;
- if(lagi=='Y'||lagi=='y')
- goto menuutama;
- else if(lagi=='T'||lagi=='t')
- goto keluar;
- /*(switch(lagi)
- {
- case 'Y':
- goto menuutama;
- case 'y':
- goto menuutama;
- break;
- case 'T':
- goto keluar;
- case 't':
- goto keluar;
- break;
- }*/
- //getch();
- keluar:
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement