Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.04 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. char garis(){
  6. cout << "---------------------------------------------------------" << endl;
  7. }
  8. char space(){
  9. cout << " " << endl;
  10. }
  11.  
  12. char templateMenu (){
  13.  
  14. garis();
  15. cout << "** Selamat datang di Salty Spitoon Cinemas **" << endl;
  16. garis();
  17. space();
  18. garis();
  19. cout << "Kode | Judul Film | Harga sewa/hari |" << endl;
  20. garis();
  21. cout << "A | Ayat - ayat cinta | Rp.15.000 |" << endl;
  22. garis();
  23. cout << "H | Hantu setan Manggarai | Rp.12.500 |" << endl;
  24. garis();
  25. cout << "J | James Bond | Rp.12.000 |" << endl;
  26. garis();
  27. cout << "D | Drop Out | Rp.10.000 |" << endl;
  28. garis();
  29. cout << "K | Kungfu Panda | Rp.8.500 |" << endl;
  30. garis();
  31. cout << "** Promo Sewa 10 hari lebih dapat potongan harga 10%! **" << endl;
  32. garis();
  33. }
  34.  
  35. char pilihan(){
  36. cout << "Apakah anda ingin melanjutkan [y/n] ? " << endl;
  37. }
  38. main(){
  39. templateMenu();
  40.  
  41. option :
  42. int total, hari, disc;
  43. char kode, pil;
  44.  
  45. cout << "Masukan kode Film : "; cin >> kode;
  46.  
  47.  
  48. if (kode == 'A' || kode == 'a'){
  49. cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
  50. total = 15000 * hari;
  51. cout << "Anda akan menyewa film Ayat-ayat Cinta dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
  52. pilihan();
  53. cin >> pil;
  54. if(pil == 'H' || pil == 'h'){
  55. total = 15000 * hari;
  56. disc = total * 0.10;
  57. if(hari >= 10){
  58. cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
  59. total = total - disc;
  60. }else{
  61. cout << "Anda tidak mendapat potongan" << endl;
  62. }
  63. cout << "Total yang harus anda bayar adalah : Rp." << total << endl;
  64. }else{
  65. return 0;
  66. }
  67. }else if (kode == 'B' || kode == 'b'){
  68. cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
  69. total = 12500 * hari;
  70. cout << "Anda akan menyewa film Hantu Setan Manggarai dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
  71. pilihan();
  72. cin >> pil;
  73. if(pil == 'Y' || pil == 'y'){
  74. total = 12500 * hari;
  75. disc = total * 0.10;
  76. if(hari >= 10){
  77. cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
  78. total = total - disc;
  79. }else{
  80. cout << "Anda tidak mendapat potongan" << endl;
  81. }
  82. cout << "Total yang harus anda bayar adalah : Rp." << total << ",-" << endl;
  83. }else{
  84. goto option;
  85. }
  86. }else if (kode == 'J' || kode == 'j'){
  87. cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
  88. total = 12000 * hari;
  89. cout << "Anda akan menyewa film James Bond dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
  90. pilihan();
  91. cin >> pil;
  92. if(pil == 'Y' || pil == 'y'){
  93. total = 12000 * hari;
  94. disc = total * 0.10;
  95. if(hari >= 10){
  96. cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
  97. total = total - disc;
  98. }else{
  99. cout << "Anda tidak mendapat potongan" << endl;
  100. }
  101. cout << "Total yang harus anda bayar adalah : Rp." << total << ",-" << endl;
  102. }else{
  103. goto option;
  104. }
  105. }else if (kode == 'D' || kode == 'd'){
  106. cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
  107. total = 10000 * hari;
  108. cout << "Anda akan menyewa film Drop Out dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
  109. pilihan();
  110. cin >> pil;
  111. if(pil == 'Y' || pil == 'y'){
  112. total = 10000 * hari;
  113. disc = total * 0.10;
  114. if(hari >= 10){
  115. cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
  116. total = total - disc;
  117. }else{
  118. cout << "Anda tidak mendapat potongan" << endl;
  119. }
  120. cout << "Total yang harus anda bayar adalah : Rp." << total << ",-" << endl;
  121. }else{
  122. goto option;
  123. }
  124. }else if (kode == 'K' || kode == 'k'){
  125. cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
  126. total = 8500 * hari;
  127. cout << "Anda akan menyewa film Drop Out dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
  128. pilihan();
  129. cin >> pil;
  130. if(pil == 'Y' || pil == 'y'){
  131. total = 8500 * hari;
  132. disc = total * 0.10;
  133. if(hari >= 10){
  134. cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
  135. total = total - disc;
  136. }else{
  137. cout << "Anda tidak mendapat potongan" << endl;
  138. }
  139. cout << "Total yang harus anda bayar adalah : Rp." << total << ",-" << endl;
  140. }else{
  141. goto option;
  142. }
  143. }
  144. else {
  145. cout << "Kode yang anda masukan salah !" << endl;
  146. pilihan();
  147. cin >> pil;
  148. if(pil == 'Y' || pil == 'y'){
  149. goto option;
  150. }else{
  151. cout << "** Terima Kasih sudah mengunjungi :) **";
  152. }
  153. }
  154.  
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement