Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- char garis(){
- cout << "---------------------------------------------------------" << endl;
- }
- char space(){
- cout << " " << endl;
- }
- char templateMenu (){
- garis();
- cout << "** Selamat datang di Salty Spitoon Cinemas **" << endl;
- garis();
- space();
- garis();
- cout << "Kode | Judul Film | Harga sewa/hari |" << endl;
- garis();
- cout << "A | Ayat - ayat cinta | Rp.15.000 |" << endl;
- garis();
- cout << "H | Hantu setan Manggarai | Rp.12.500 |" << endl;
- garis();
- cout << "J | James Bond | Rp.12.000 |" << endl;
- garis();
- cout << "D | Drop Out | Rp.10.000 |" << endl;
- garis();
- cout << "K | Kungfu Panda | Rp.8.500 |" << endl;
- garis();
- cout << "** Promo Sewa 10 hari lebih dapat potongan harga 10%! **" << endl;
- garis();
- }
- char pilihan(){
- cout << "Apakah anda ingin melanjutkan [y/n] ? " << endl;
- }
- main(){
- templateMenu();
- option :
- int total, hari, disc;
- char kode, pil;
- cout << "Masukan kode Film : "; cin >> kode;
- if (kode == 'A' || kode == 'a'){
- cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
- total = 15000 * hari;
- cout << "Anda akan menyewa film Ayat-ayat Cinta dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
- pilihan();
- cin >> pil;
- if(pil == 'H' || pil == 'h'){
- total = 15000 * hari;
- disc = total * 0.10;
- if(hari >= 10){
- cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
- total = total - disc;
- }else{
- cout << "Anda tidak mendapat potongan" << endl;
- }
- cout << "Total yang harus anda bayar adalah : Rp." << total << endl;
- }else{
- return 0;
- }
- }else if (kode == 'B' || kode == 'b'){
- cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
- total = 12500 * hari;
- cout << "Anda akan menyewa film Hantu Setan Manggarai dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
- pilihan();
- cin >> pil;
- if(pil == 'Y' || pil == 'y'){
- total = 12500 * hari;
- disc = total * 0.10;
- if(hari >= 10){
- cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
- total = total - disc;
- }else{
- cout << "Anda tidak mendapat potongan" << endl;
- }
- cout << "Total yang harus anda bayar adalah : Rp." << total << ",-" << endl;
- }else{
- goto option;
- }
- }else if (kode == 'J' || kode == 'j'){
- cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
- total = 12000 * hari;
- cout << "Anda akan menyewa film James Bond dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
- pilihan();
- cin >> pil;
- if(pil == 'Y' || pil == 'y'){
- total = 12000 * hari;
- disc = total * 0.10;
- if(hari >= 10){
- cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
- total = total - disc;
- }else{
- cout << "Anda tidak mendapat potongan" << endl;
- }
- cout << "Total yang harus anda bayar adalah : Rp." << total << ",-" << endl;
- }else{
- goto option;
- }
- }else if (kode == 'D' || kode == 'd'){
- cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
- total = 10000 * hari;
- cout << "Anda akan menyewa film Drop Out dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
- pilihan();
- cin >> pil;
- if(pil == 'Y' || pil == 'y'){
- total = 10000 * hari;
- disc = total * 0.10;
- if(hari >= 10){
- cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
- total = total - disc;
- }else{
- cout << "Anda tidak mendapat potongan" << endl;
- }
- cout << "Total yang harus anda bayar adalah : Rp." << total << ",-" << endl;
- }else{
- goto option;
- }
- }else if (kode == 'K' || kode == 'k'){
- cout << "Masukan berapa hari anda menyewa film : "; cin >> hari;
- total = 8500 * hari;
- cout << "Anda akan menyewa film Drop Out dengan durasi " << hari << " hari, dengan biaya : Rp." << total << ",-" << endl;
- pilihan();
- cin >> pil;
- if(pil == 'Y' || pil == 'y'){
- total = 8500 * hari;
- disc = total * 0.10;
- if(hari >= 10){
- cout << "Anda mendapat potongan 10% sebesar : Rp." << disc << ",-" << endl;
- total = total - disc;
- }else{
- cout << "Anda tidak mendapat potongan" << endl;
- }
- cout << "Total yang harus anda bayar adalah : Rp." << total << ",-" << endl;
- }else{
- goto option;
- }
- }
- else {
- cout << "Kode yang anda masukan salah !" << endl;
- pilihan();
- cin >> pil;
- if(pil == 'Y' || pil == 'y'){
- goto option;
- }else{
- cout << "** Terima Kasih sudah mengunjungi :) **";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement