#include<conio.h>
#include<iostream.h>
void main()
{
long int jumlah,jlh_sewa,lama_sewa,tgl_sewa,tgl_kembali,bulan_sewa,bulan_kembali,th_sewa,th_kembali;
long int tot_bayar,denda;
clrscr();
cout<<endl<<endl;
cout<<" ***************************************************"<<endl;
cout<<" * PROGRAM RENTAL MOBIL SEDERHANA *"<<endl;
cout<<" * KHUSUS UNTUK MASA SEWA MAX=11 BULAN *"<<endl;
cout<<"++***************************************************+++++++++++++"<<endl;
cout<<"+ JIKA LAMA SEWA LEBIH DARI 11 BULAN MAKA MOBIL DIAMBIL PAKSA +"<<endl;
cout<<"+ Harga sewa MOBIL = Rp. 100.000/hari +"<<endl;
cout<<"+ jika lama sewa > 30 hari, denda = Rp. 10.000/hari +"<<endl;
cout<<"+ 1 Bulan = 30 hari +"<<endl;
cout<<"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<" Jumlah sewa = ";
cin>>jumlah;
cout<<" Tanggal sewa [1-30] = ";
cin>>tgl_sewa;
cout<<" Bulan [1-12] = ";
cin>>bulan_sewa;
cout<<" Tahun sewa = ";
cin>>th_sewa;
cout<<" Tanggal pengembalian [1-30] = ";
cin>>tgl_kembali;
cout<<" Bulan Pengembalian [1-12] = ";
cin>>bulan_kembali;
cout<<" Tahun Pengembalian = ";
cin>>th_kembali;
if (bulan_kembali==bulan_sewa)
lama_sewa=tgl_kembali-tgl_sewa;
else if (bulan_sewa<bulan_kembali)
lama_sewa=((bulan_kembali-bulan_sewa-1)*30)+30-tgl_sewa+tgl_kembali;
else if(bulan_kembali<bulan_sewa && th_kembali>th_sewa)
lama_sewa=(12-bulan_sewa+bulan_kembali)*30-tgl_sewa+tgl_kembali;
if (lama_sewa>30)
denda=((lama_sewa-30)*10000)*jumlah;
else
denda=0;
tot_bayar=((lama_sewa*100000)*jumlah)+denda;
cout<<endl;
cout<<" ++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<" + TAMPILAN HASIL PROSES "<<endl;
cout<<" + ========================= "<<endl;
cout<<" + Tanggal penyewaan = "<<tgl_sewa<<" / "<<bulan_sewa<<" / "<<th_sewa<<endl;
cout<<" + Tanggal pengembalian = "<<tgl_kembali<<" / "<<bulan_kembali<<" / "<<th_kembali<<endl;
cout<<" + Lama penyewaan = "<<lama_sewa<<" hari "<<endl;
cout<<" + Jumlah mobil yang disewa = "<<jumlah<<" buah"<<endl;
cout<<" + Denda yang dibebankan = "<<denda<<endl;
cout<<" + Total bayar = "<<tot_bayar<<endl;
cout<<" +++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\n\n\n\n\n <<==CREATED BY : JAYARI (10 54 0040)"<<endl;
cout<<"\n\n PRESS ANYKEY TO EXIT..!!!";
getch();
}
My facebook
#include<iostream.h>
void main()
{
long int jumlah,jlh_sewa,lama_sewa,tgl_sewa,tgl_kembali,bulan_sewa,bulan_kembali,th_sewa,th_kembali;
long int tot_bayar,denda;
clrscr();
cout<<endl<<endl;
cout<<" ***************************************************"<<endl;
cout<<" * PROGRAM RENTAL MOBIL SEDERHANA *"<<endl;
cout<<" * KHUSUS UNTUK MASA SEWA MAX=11 BULAN *"<<endl;
cout<<"++***************************************************+++++++++++++"<<endl;
cout<<"+ JIKA LAMA SEWA LEBIH DARI 11 BULAN MAKA MOBIL DIAMBIL PAKSA +"<<endl;
cout<<"+ Harga sewa MOBIL = Rp. 100.000/hari +"<<endl;
cout<<"+ jika lama sewa > 30 hari, denda = Rp. 10.000/hari +"<<endl;
cout<<"+ 1 Bulan = 30 hari +"<<endl;
cout<<"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<" Jumlah sewa = ";
cin>>jumlah;
cout<<" Tanggal sewa [1-30] = ";
cin>>tgl_sewa;
cout<<" Bulan [1-12] = ";
cin>>bulan_sewa;
cout<<" Tahun sewa = ";
cin>>th_sewa;
cout<<" Tanggal pengembalian [1-30] = ";
cin>>tgl_kembali;
cout<<" Bulan Pengembalian [1-12] = ";
cin>>bulan_kembali;
cout<<" Tahun Pengembalian = ";
cin>>th_kembali;
if (bulan_kembali==bulan_sewa)
lama_sewa=tgl_kembali-tgl_sewa;
else if (bulan_sewa<bulan_kembali)
lama_sewa=((bulan_kembali-bulan_sewa-1)*30)+30-tgl_sewa+tgl_kembali;
else if(bulan_kembali<bulan_sewa && th_kembali>th_sewa)
lama_sewa=(12-bulan_sewa+bulan_kembali)*30-tgl_sewa+tgl_kembali;
if (lama_sewa>30)
denda=((lama_sewa-30)*10000)*jumlah;
else
denda=0;
tot_bayar=((lama_sewa*100000)*jumlah)+denda;
cout<<endl;
cout<<" ++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<" + TAMPILAN HASIL PROSES "<<endl;
cout<<" + ========================= "<<endl;
cout<<" + Tanggal penyewaan = "<<tgl_sewa<<" / "<<bulan_sewa<<" / "<<th_sewa<<endl;
cout<<" + Tanggal pengembalian = "<<tgl_kembali<<" / "<<bulan_kembali<<" / "<<th_kembali<<endl;
cout<<" + Lama penyewaan = "<<lama_sewa<<" hari "<<endl;
cout<<" + Jumlah mobil yang disewa = "<<jumlah<<" buah"<<endl;
cout<<" + Denda yang dibebankan = "<<denda<<endl;
cout<<" + Total bayar = "<<tot_bayar<<endl;
cout<<" +++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\n\n\n\n\n <<==CREATED BY : JAYARI (10 54 0040)"<<endl;
cout<<"\n\n PRESS ANYKEY TO EXIT..!!!";
getch();
}
My facebook
No comments:
Post a Comment