Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <conio>
- #include <iostream>
- #include <stdio>
- #include <windows>
- void title()
- {
- cout<<"PENGINAPAN PASTI BETAH"<<endl;
- }
- void garis()
- {
- cout<<"*********************************************\n"<<endl;
- }
- main()
- {
- char ulang,kode,nama[10],tipe[20],souvenir[20];
- long uangkembali,uangbayar,harga,biayasewa,admin,totalbiayasewa;
- int lama;
- atas:
- title();
- garis();
- cout<<"Nama Penyewa\t\t:";gets(nama);
- cout<<"Kode Kamar [A/B/M]\t:";cin>>kode;
- clrscr();
- if(kode=='A' || kode =='a')
- {
- strcpy(tipe,"Anggrek");
- harga=300000;
- }
- else if(kode=='B' || kode =='b')
- {
- strcpy(tipe,"Bougenville");
- harga=300000;
- }
- else if(kode=='M' || kode =='m')
- {
- strcpy(tipe,"Mawar");
- harga=300000;
- }
- else{
- cout<<"SALAH KODE !!!!!!!"<<endl;
- goto salah;
- }
- title();
- garis();
- cout<<"Nama Penyewa\t:"<<nama<<endl;
- cout<<"Kode Kamar [A/B/M]:"<<kode<<endl;
- cout<<"Lama Menginap\t:";cin>>lama;
- if(lama>=7)
- {
- strcpy(souvenir,"Payung Cantik");
- }
- else
- strcpy(souvenir,"Tidak Dapat souvenir");
- garis();
- cout<<"Tipe Kamar\t:"<<tipe<<endl;
- cout<<"Lama Menginap\t:"<<lama<<"Hari"<<endl;
- cout<<"Souvenir\t:"<<souvenir<<endl;
- biayasewa=lama*harga;
- cout<<"Biaya Sewa\t:"<<biayasewa<<endl;
- admin=200000;
- cout<<"Biaya Administrasi\t:"<<admin<<endl;
- totalbiayasewa=biayasewa+admin;
- cout<<"Total Biaya Sewa\t:"<<totalbiayasewa<<endl;
- garis();
- cout<<"Uang Bayar\t:";cin>>uangbayar;
- uangkembali=uangbayar-totalbiayasewa;
- cout<<"Uang kembali\t:"<<uangkembali<<endl;
- salah:
- cout<<"Ingin Input Lagi [Y/T]:";cin>>ulang;
- clrscr();
- if(ulang == 'Y' || ulang == 'y')
- {
- goto atas;
- }else
- return(0);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment