Advertisement
kagemaro

Untitled

Jan 6th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.58 KB | None | 0 0
  1. #include <conio.h>
  2. #include <iostream.h>
  3. #include <iomanip.h>
  4. #include <stdio.h>
  5. head()
  6. {
  7. cout<<"                  PENYEWAAN PAKAIAN ADAT NASIONAL\n";
  8. cout<<"                          CHONIO BOUTIQUE \n";
  9. cout<<"                 *********************************\n";
  10. }
  11. bintang()
  12. {
  13. cout<<"*********************************************************************\n";
  14. }
  15. main()
  16. {
  17. int pil,j,i,tb,ls,ub,uk,tot;
  18. char np[30],lop;
  19.  
  20. struct
  21. {
  22. char *npak,kode[5],ukuran;
  23. int harga,js,sub;
  24. }kolom[5];
  25.  
  26. head();
  27. cout<<"       Selamat Datang Di Chonio Boutique \n\n";
  28. cout<<"       Pilihan Menu : \n";
  29. cout<<"       1. Input Data\n";
  30. cout<<"       2. Log Out \n";
  31. cout<<"       ===========================================\n";
  32. cout<<"       Inputkan Pilihan Anda : ";cin>>pil;
  33. if (pil==1)
  34. { goto mulai; }
  35. else
  36. { return 0;  }
  37.  
  38. mulai:
  39. clrscr();
  40. head();
  41. cout<<"Nama Penyewa      : ";gets(np);
  42. cout<<"Input Lama Sewa   : ";cin>>ls;
  43. cout<<"Input Jumlah Data : ";cin>>j;
  44. cout<<endl<<endl;
  45. cout<<"******************************************\n";
  46. for (i=1;i<=j;i++)
  47. {
  48. cout<<"Data ke-"<<i<<endl;
  49. cout<<"Input Kode Paket Baju [JB/JT/SB] : ";cin>>kolom[i].kode;
  50. cout<<"Input Kode Ukuran Baju [S/M/L]   : ";cin>>kolom[i].ukuran;
  51. cout<<"Jumlah Sewa : ";cin>>kolom[i].js;
  52. }
  53. clrscr();
  54. head();
  55. cout<<"Nama Penyewa  : "<<np<<endl<<endl;
  56. cout<<"Data Baju Yang Disewa\n";
  57. bintang();
  58. cout<<"No.  Nama Paket      Harga        Jumlah Sewa     Subtotal  \n";
  59. bintang();
  60. for (i=1;i<=j;i++)
  61. {
  62. cout<<setiosflags(ios::left)<<setw(5)<<i;
  63. if ((!strcmp (kolom[i].kode,"JB"))||(!strcmp (kolom[i].kode,"jb")))
  64. {
  65.   kolom[i].npak="Jawa Barat";
  66.   if (kolom[i].ukuran=='s'||kolom[i].ukuran=='S')
  67.   kolom[i].harga=200000;
  68.   else if (kolom[i].ukuran=='M'||kolom[i].ukuran=='m')
  69.   kolom[i].harga=250000;
  70.   else if (kolom[i].ukuran=='L'||kolom[i].ukuran=='l')
  71.   kolom[i].harga=275000;
  72. }
  73. else if ((!strcmp (kolom[i].kode,"JT"))||(!strcmp (kolom[i].kode,"jt")))
  74. {
  75.   kolom[i].npak="Jawa Tengah";
  76.   if (kolom[i].ukuran=='s'||kolom[i].ukuran=='S')
  77.   kolom[i].harga=205000;
  78.   else if (kolom[i].ukuran=='M'||kolom[i].ukuran=='m')
  79.   kolom[i].harga=255000;
  80.   else if (kolom[i].ukuran=='L'||kolom[i].ukuran=='l')
  81.   kolom[i].harga=280000;
  82. }
  83. else if ((!strcmp(kolom[i].kode,"SB"))||(!strcmp(kolom[i].kode,"sb")))
  84. {
  85.   kolom[i].npak="Sumatera Barat";
  86.   if (kolom[i].ukuran=='s'||kolom[i].ukuran=='S')
  87.   kolom[i].harga=230000;
  88.   else if (kolom[i].ukuran=='M'||kolom[i].ukuran=='m')
  89.   kolom[i].harga=260000;
  90.   else if (kolom[i].ukuran=='L'||kolom[i].ukuran=='l')
  91.   kolom[i].harga=300000;
  92. }
  93. else
  94. {
  95.   kolom[i].npak="Salah KODE !!";
  96.   if (kolom[i].ukuran=='s'||kolom[i].ukuran=='S')
  97.   kolom[i].harga=0;
  98.   else if (kolom[i].ukuran=='M'||kolom[i].ukuran=='m')
  99.   kolom[i].harga=0;
  100.   else if (kolom[i].ukuran=='L'||kolom[i].ukuran=='l')
  101.   kolom[i].harga=0;
  102. }
  103. cout<<setiosflags(ios::left)<<setw(16)<<kolom[i].npak;
  104. cout<<setiosflags(ios::left)<<setw(13)<<kolom[i].harga;
  105. cout<<setiosflags(ios::left)<<setw(16)<<kolom[i].js;
  106. kolom[i].sub=kolom[i].harga*kolom[i].js;
  107. cout<<setiosflags(ios::left)<<setw(16)<<kolom[i].sub<<endl;
  108. tot=tot+kolom[i].sub;
  109. }
  110. bintang();
  111. tb=tot*ls;
  112. cout<<"                                    Jumlah Biaya : "<<tot<<endl;
  113. cout<<"          Total Biaya (Jumlah Biaya x Lama Sewa) : "<<tb<<endl;
  114. cout<<"                                      Uang Bayar : ";cin>>ub;
  115. uk=ub-tb;
  116. cout<<"                                    Uang Kembali : "<<uk<<endl;
  117. cout<<"\n             ****TERIMA KASIH**** \n";
  118.  
  119.  
  120. cout<<"Input Data Lagi [Y/T] : ";cin>>lop;
  121. if (lop=='y'||lop=='Y')
  122. { goto mulai; }
  123. else
  124. { return 0;  }
  125.  
  126. getch();
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement