Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program Penginapan Pasti Betah
- // Task No.3 file 066-P04B.pptx
- // Amrul Mubarak Harahap
- // 19T03 - 1901098
- #include <iostream>
- #include <string>
- #include <iomanip>
- using namespace std;
- int main(){
- char kodeKmr, ulang;
- string namaPenyewa, tipeKmr, souvenir;
- int lama, hargaSwa, biayaAdm, total, bayar, kembalian;
- menu:
- system("cls");
- cout << "\nPENGINAPAN PASTI BETAH" << endl;
- cout << "==================================================" << endl << endl;
- cout << "Nama Penyewa : "; cin >> namaPenyewa;
- cout << "Kode Kamar [A/B/C] : "; cin >> kodeKmr;
- system("cls");
- cout << "\nPENGINAPAN PASTI BETAH" << endl;
- cout << "==================================================" << endl << endl;
- cout << "Nama Penyewa : " << namaPenyewa << endl;
- cout << "Kode Kamar : " << kodeKmr << endl;
- cout << "Lama Menginap(hari) : "; cin >> lama;
- cout << "\n==================================================" << endl;
- biayaAdm = 200000;
- switch (kodeKmr){
- case 'A' : case 'a':
- tipeKmr = "Anggrek";
- hargaSwa = 300000;
- if(lama >= 7){
- souvenir = "Payung Cantik";
- } else {
- souvenir = "Tidak Ada";
- }
- break;
- case 'B' : case 'b':
- tipeKmr = "Bougenville";
- hargaSwa = 250000;
- if(lama >= 7){
- souvenir = "Payung Cantik";
- } else {
- souvenir = "Tidak Ada";
- }
- break;
- case 'C' : case 'c':
- tipeKmr = "Mawar";
- hargaSwa = 200000;
- if(lama >= 7){
- souvenir = "Payung Cantik";
- } else {
- souvenir = "Tidak Ada";
- }
- break;
- }
- total = lama * hargaSwa + biayaAdm;
- cout << "\nTipe Kamar : " << tipeKmr << endl;
- cout << "Lama Menginap : " << lama << " hari" << endl;
- cout << "Souvenir : " << souvenir << endl;
- cout << "Biaya Sewa : Rp" << hargaSwa << endl;
- cout << "Biaya Administrasi : Rp" << biayaAdm << endl;
- cout << "Total Biaya Sewa : Rp" << total << endl;
- cout << "\n==================================================" << endl;
- cout << "\nUang Bayar : Rp"; cin >> bayar;
- kembalian = bayar -total;
- cout << "Uang Kembali : Rp" << kembalian << endl;
- cout << "\nIngin input data lagi?(Y/T): "; cin >> ulang;
- if(ulang == 'Y' || ulang == 'y'){
- goto menu;
- } else {
- goto akhir;
- }
- akhir:
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement