-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
70 lines (66 loc) · 2.03 KB
/
main.cpp
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// main.cpp
// projectfinal2
//
#include "HotelManagementSystem.h"
#include <iostream>
using namespace std;
void displayMenu() {
cout << "1. Display Hotel Description" << endl;
cout << "2. Check-in Customer" << endl;
cout << "3. Check-out Customer" << endl;
cout << "4. View Available Rooms" << endl;
cout << "5. View Booked Rooms" << endl;
cout << "6. Save Current State to File" << endl;
cout << "7. Exit" << endl;
cout << "Enter your choice: ";
}
int main() {
HotelManagementSystem hms("hotel_data.txt");
int choice;
do {
displayMenu();
cin >> choice;
switch (choice) {
case 1:
hms.displayHotelDescription();
break;
case 2: {
int roomNumber;
string customerName, checkInDate, checkOutDate;
cout << "Enter Room Number: ";
cin >> roomNumber;
cout << "Enter Customer Name: ";
cin >> customerName;
cout << "Enter Check-in Date (YYYY-MM-DD): ";
cin >> checkInDate;
cout << "Enter Check-out Date (YYYY-MM-DD): ";
cin >> checkOutDate;
hms.checkInCustomer(roomNumber, customerName, checkInDate, checkOutDate);
break;
}
case 3: {
int roomNumber;
cout << "Enter Room Number: ";
cin >> roomNumber;
hms.checkOutCustomer(roomNumber);
break;
}
case 4:
hms.viewAvailableRooms();
break;
case 5:
hms.viewBookedRooms();
break;
case 6:
hms.saveCurrentStateToFile("hotel_data.txt");
break;
case 7:
cout << "Exiting..." << endl;
break;
default:
cout << "Invalid choice, please try again." << endl;
}
} while (choice != 7);
return 0;
}