Program Kasir Losmen
Dengan Menggunakan C++
#include <conio.h>
#include <iostream.h>
main()
{
char np[23],ab[23],kk,jk[23];
int li;
long hg,bi,tb,dc,gt,ub,uk;
cout<<"\t\t**********=========*************\n";
cout<<"\t\t\t Losmen " "Rainbow Inn" "\n";
cout<<"\t\t\tNota Booking Kamar Losmen\n";
cout<<"\t\t===================================\n\n";
cout<<"Input nama Petugas\t\t:";
cin>>np;
cout<<"Input nama Costumer\t\t:";
cin>>ab;
cout<<"\nInput Kode Kamar[S/D/F]\t\t:";
cin>>kk;
cout<<"Input Lama inap\t\t\t:";
cin>>li;
clrscr();
cout<<"\t\t**********=========*************\n";
cout<<"\t\t\t Losmen " "Rainbow Inn" "\n";
cout<<"\t\t\tNota Booking Kamar Losmen\n";
cout<<"\t\t===================================\n\n";
cout<<"Nama Petugas\t\t\t:"<<np<<endl;
cout<<"Nama Costumer\t\t\t:"<<ab<<endl;
if(kk=='S')
{strcpy (jk,"Standard Room-Single bed");
hg=125000;
}
else if(kk=='D')
{strcpy (jk,"Deluxe Room-Double bed,Include breakfast");
hg=225000;
}
else if(kk=='S')
{strcmp (jk,"Family Room-Double bed,extra bed,Include bed");
hg=270000;
}
else
{strcpy (jk,"0");
hg=0;
}
cout<<"Jenis Kamar\t\t\t:"<<jk<<endl;
cout<<"Biaya Inap/hari\t\t\t:Rp"<<hg<<endl;
cout<<"Lama inap\t\t\t:"<<li<<endl;
cout<<"\t\t===================================================\n\n";
tb=li*hg;
cout<<"\t\t\t\tTotal Bayar\t\t\t:Rp."<<tb<<endl;
if (li>3)
dc=0.05*tb;
else
dc=0;
cout<<"\t\t\t\tDiscont\t\t\t\t:Rp."<<dc<<endl;
gt=tb-dc;
cout<<"\t\t\t\tGrand Total\t\t\t:Rp."<<gt<<endl;
cout<<"\t\t\t\tUang Bayar\t\t\t:Rp.";
cin>>ub;
uk=ub-gt;
cout<<"\t\t\t\tuang Kembali\t\t\t:Rp."<<uk<<endl;
getch();
}
#include <iostream.h>
main()
{
char np[23],ab[23],kk,jk[23];
int li;
long hg,bi,tb,dc,gt,ub,uk;
cout<<"\t\t**********=========*************\n";
cout<<"\t\t\t Losmen " "Rainbow Inn" "\n";
cout<<"\t\t\tNota Booking Kamar Losmen\n";
cout<<"\t\t===================================\n\n";
cout<<"Input nama Petugas\t\t:";
cin>>np;
cout<<"Input nama Costumer\t\t:";
cin>>ab;
cout<<"\nInput Kode Kamar[S/D/F]\t\t:";
cin>>kk;
cout<<"Input Lama inap\t\t\t:";
cin>>li;
clrscr();
cout<<"\t\t**********=========*************\n";
cout<<"\t\t\t Losmen " "Rainbow Inn" "\n";
cout<<"\t\t\tNota Booking Kamar Losmen\n";
cout<<"\t\t===================================\n\n";
cout<<"Nama Petugas\t\t\t:"<<np<<endl;
cout<<"Nama Costumer\t\t\t:"<<ab<<endl;
if(kk=='S')
{strcpy (jk,"Standard Room-Single bed");
hg=125000;
}
else if(kk=='D')
{strcpy (jk,"Deluxe Room-Double bed,Include breakfast");
hg=225000;
}
else if(kk=='S')
{strcmp (jk,"Family Room-Double bed,extra bed,Include bed");
hg=270000;
}
else
{strcpy (jk,"0");
hg=0;
}
cout<<"Jenis Kamar\t\t\t:"<<jk<<endl;
cout<<"Biaya Inap/hari\t\t\t:Rp"<<hg<<endl;
cout<<"Lama inap\t\t\t:"<<li<<endl;
cout<<"\t\t===================================================\n\n";
tb=li*hg;
cout<<"\t\t\t\tTotal Bayar\t\t\t:Rp."<<tb<<endl;
if (li>3)
dc=0.05*tb;
else
dc=0;
cout<<"\t\t\t\tDiscont\t\t\t\t:Rp."<<dc<<endl;
gt=tb-dc;
cout<<"\t\t\t\tGrand Total\t\t\t:Rp."<<gt<<endl;
cout<<"\t\t\t\tUang Bayar\t\t\t:Rp.";
cin>>ub;
uk=ub-gt;
cout<<"\t\t\t\tuang Kembali\t\t\t:Rp."<<uk<<endl;
getch();
}
hasil...:
Tampilan !......:
Tampilan 2.......:
Semoga Bermanfaat.....................!!!!!!!!!!!!!!!!!!111