#include<iostream>
#include<conio>
#include<cstring>
main()
{
int kode, hasil1, hasil2, hasil3, x, p=50000, s=4000;
string nama;
char status;
cout<<"\n PERPUSTAKAAN FAWAIQ BLOG KOTA PATI\n";
cout<<" by : http://mohnurfawaiq.blogspot.com \n ======================================================\n \n";
cout<<" ==============Daftar Buku==============\n";
cout<<" |-----------|------------|------------|\n";
cout<<" |-KODE BUKU-|-JENIS BUKU-|-TARIF BUKU-|\n";
cout<<" |-----------|------------|------------|\n";
cout<<" |----01-----|-Pemrograman|---5000-----|\n";
cout<<" |----02-----|---Sastra---|---4000-----|\n";
cout<<" |----03-----|---Novel----|---3000-----|\n";
cout<<" |-----------|------------|------------|\n";
cout<<"\n Nama Penyewa Buku : "; cin>>nama;
cout<<" Selamat Datang ["<<nama;
cout<<"] di Perpustakaan Fawaiq Blog.\n";
cout<<"\n Banyak Pinjam Buku : "; cin>>x;
a:
cout<<"\n Masukkan Kode Buku : "; cin>>kode;
if(kode==01)
{
cout<<"\n Tarif Sewa Rp. 5000\n";
cout<<" Jenis Buku Pemrograman\n";
cout<<" Penyewa Dengan Nama " <<nama;
hasil1=x*p;
cout<<"\n\n Jumlah Bayar Penyewaan Sebesar Rp. " <<hasil1<<endl;
{
cout<<"\n\n Apakah Anda Ingin Mencoba Lagi ? (y=yes / n=no) : "; cin>>status;
if(status =='y' || status =='Y')
goto a;
else
goto end;
}
}
else if(kode==02)
{
cout<<" Tarif Sewa Rp. 4000\n";
cout<<" Jenis Buku Sastra\n";
cout<<" Penyewa Dengan Nama " <<nama;
hasil2=x*s;
cout<<"\n\n Jumlah Bayar Penyewaan Sebesar Rp. " <<hasil2<<endl;
{
cout<<"\n\n Apakah Anda Ingin Mencoba Lagi ? (y=yes / n=no) : "; cin>>status;
if(status =='y' || status =='Y')
goto a;
else
goto end;
}
}
else if(kode==03)
{
cout<<" Tarif Sewa Rp. 3000\n";
cout<<" Jenis Buku Novel\n";
cout<<" Penyewa Dengan Nama " <<nama;
hasil3=x*s;
cout<<"\n\n Jumlah Bayar Penyewaan Sebesar Rp. " <<hasil3<<endl;
{
cout<<"\n\n Apakah Anda Ingin Mencoba Lagi ? (y=yes / n=no) : "; cin>>status;
if(status =='y' || status =='Y')
goto a;
else
goto end;
}
}
else
{
cout<<"\n WARNING!!! \n Kode Buku Yang Anda Masukkan Salah! \n Silahkan Ulangi Kembali!\n";
goto a;
}
end:
cout<<"\n\n ==============================";
cout<<"\n Terimakasih Atas Kunjungannya.";
cout<<"\n ==============================";
getch();
}