#include <iostream.h>
#include <conio.h>
void kcb();
void spe();
void enh();
void main()
{
char kodefilm, *judul;
int hargafilm, jumlahtiket, subtotal, ppn, bayartotal, uangbayar, balik;
    cout << "========================================"<<endl;
    cout << "BIOSKOP JATIWARINGIN    "<<endl;
    cout << "========================================"<<endl;
    cout << "Masukan Kode Film [1-3] : ";
   cin >> kodefilm;
   if (kodefilm=='1')
   {
   kcb();
   hargafilm = 23000;
   judul = "KCB";
   }
   else if (kodefilm=='2')
   {
   spe();
   hargafilm = 25000;
   judul = "SPE";
   }
   else if (kodefilm=='3')
   {
   enh();
   hargafilm = 25000;
   judul = "ENH";
   }
   else
   {
   cout << "Maaf, kode yang anda masukkan salah" << endl;
    }
   cout << endl;
   cout << "Masukkan jumlah tiket yang ingin anda beli: ";
   cin >> jumlahtiket;
   subtotal = jumlahtiket * hargafilm;
   cout << endl;
   ppn = subtotal * 0.1;
   bayartotal = subtotal + ppn;
   cout << "=====================================" << endl;
   cout << "LAPORAN DATA BIOSKOP JATIWARINGIN" << endl;
   cout << "=====================================" << endl;
   cout << "No. Kode Film   Judul Film    Jumlah Beli    Subtotal    Ppn Total"<<endl;
   cout << "1   "<<kodefilm<<"           "<<judul<<"           "<<jumlahtiket<<"              "<<subtotal<< "      "<<ppn<<endl;
   cout << "-------------------------------------------------------------------"<<endl;
   cout << "Total Bayar       : Rp. "<<bayartotal<<endl;
   cout << endl;
   cout <<"Masukkan Uang Bayar: Rp. ";
   cin>>uangbayar;
   balik= uangbayar - bayartotal;
   cout <<"Kembalian          : Rp. "<<balik;
   getch();
}
void kcb()
{
    cout << "Judul Film  : Ketika Cinta Bertasbih" << endl;
   cout << "Harga Tiket : Rp. 23.000" << endl;
}
void spe()
{
    cout << "Judul Film  : Sang Pemimpi" << endl;
   cout << "Harga Tiket : Rp. 25.000" << endl;
}
void enh()
{
    cout << "Judul Film  : Emak Naik Haji" << endl;
   cout << "Harga Tiket : Rp. 25.000" << endl;
}
Tidak ada komentar:
Posting Komentar