program c++ pemesanan kamar hotel
#include <stdio.h>
int main() {
int roomType, nights;
int roomPrice = 0;
printf("Selamat datang di sistem pemesanan kamar hotel!\n");
printf("Silakan pilih tipe kamar yang diinginkan:\n");
printf("1. Reguler (Rp500,000/malam)\n");
printf("2. VIP (Rp1,000,000/malam)\n");
printf("3. VVIP (Rp1,500,000/malam)\n");
printf("Pilih tipe kamar (1/2/3): ");
scanf("%d", &roomType);
switch(roomType) {
case 1:
roomPrice = 500000;
break;
case 2:
roomPrice = 1000000;
break;
case 3:
roomPrice = 1500000;
break;
default:
printf("Tipe kamar yang diminta tidak tersedia.\n");
return 0;
}
printf("Berapa malam Anda akan menginap? ");
scanf("%d", &nights);
int total = roomPrice * nights;
printf("Harga kamar selama %d malam adalah Rp%d\n", nights, total);
// Membuat keluaran nota
printf("\n==== NOTA PEMESANAN KAMAR HOTEL ====\n");
printf("Tipe Kamar: ");
switch(roomType) {
case 1:
printf("Reguler\n");
break;
case 2:
printf("VIP\n");
break;
case 3:
printf("VVIP\n");
break;
}
printf("Lama Menginap: %d malam\n", nights);
printf("Harga Kamar: Rp%d/malam\n", roomPrice);
printf("Total Harga: Rp%d\n", total);
printf("==================================\n");
printf("Terima kasih telah menggunakan sistem pemesanan kamar hotel kami!\n");
return 0;
}