forked from ashishps1/awesome-low-level-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHotelDemo.cpp
More file actions
49 lines (38 loc) · 1.42 KB
/
HotelDemo.cpp
File metadata and controls
49 lines (38 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "HotelManager.hpp"
#include <iostream>
int main() {
HotelManager hotel;
// Add rooms
Room* room1 = new Room("101", RoomType::STANDARD, 100.0, 2);
Room* room2 = new Room("201", RoomType::DELUXE, 150.0, 3);
Room* room3 = new Room("301", RoomType::SUITE, 250.0, 4);
hotel.addRoom(room1);
hotel.addRoom(room2);
hotel.addRoom(room3);
// Add guests
Guest* guest1 = new Guest("G001", "John Doe", "john@example.com",
"+1-555-0123", "123 Main St");
hotel.addGuest(guest1);
// Display available rooms
hotel.displayAvailableRooms();
// Create a booking
Booking* booking = hotel.createBooking("G001", "101", "2024-01-01",
"2024-01-03", 2);
if (booking) {
std::cout << "\nBooking created successfully!" << std::endl;
booking->displayInfo();
// Check in
if (hotel.checkIn(booking->getBookingId())) {
std::cout << "\nChecked in successfully!" << std::endl;
}
// Display available rooms after check-in
hotel.displayAvailableRooms();
// Check out
if (hotel.checkOut(booking->getBookingId())) {
std::cout << "\nChecked out successfully!" << std::endl;
}
// Display booking history
hotel.displayBookingHistory("G001");
}
return 0;
}