-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhotelManagement.py
122 lines (114 loc) · 4.54 KB
/
hotelManagement.py
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import random
import emoji
# Class to handle all the processes.
class hotelManagement():
def __init__(self):
self.id = 0
self.name = " "
self.phoneNumber = " "
self.address = " "
self.proof = " "
self.inDate = " "
self.outDate = " "
self.roomNo = 0
self.customers = {}
self.rent = 0
self.foodPrice = 0
# Method to register customer.
def addCustomer(self):
self.name = input("Enter name : ")
self.phoneNumber = input("Enter phone Number : ")
self.address = input("Enter address : ")
self.proof = input("Show proof : ")
self.inDate = input("Enter the check in date : ")
self.outDate = input("Enter the check put date : ")
self.roomNo = random.randint(1,401)
self.id = self.id+1
print("Customer has been added successfully")
data = f"Name : {self.name} \nProof submited : {self.proof}\nPhone Number : {self.phoneNumber}\nAddress = {self.address}\nCheck in date : {self.inDate}\nCheck out date : {self.outDate}\nRoom No : {self.roomNo}"
self.customers[self.id] = data
self.roomRent()
# Method to calculate rent of the room.
def roomRent(self):
print("1. Class A --> 10000")
print("2. Class B --> 8000")
print("3. Class C --> 6000")
roomType = int(input("Enter the room type : "))
noNights = int(input("Enter the number of nights : "))
if(roomType == 1):
cost = 10000
elif(roomType == 2):
cost = 8000
elif(roomType == 3):
cost = 6000
self.rent = cost*noNights
print("Your choosen room rent is : ",self.rent)
# Method to calculate total food cost
def foodPurchased(self):
print("1. Veg Thali -->500\n2. Non veg thali --> 550\n3. Breakfast --> 250\n4. Drinks --> 100\n5. Dessert-->200\n6. Exit")
Continue = True
while(Continue):
option = int(input("Enter your choice : "))
quantity = int(input("Enter quantity : "))
if option == 1:
cost = 500
elif option == 2:
cost = 550
elif option == 3:
cost = 250
elif option == 4:
cost = 100
elif option == 5:
cost = 200
if option == 6:
Continue = False
self.foodPrice = self.foodPrice + cost*quantity
print(f"Total food cost = {self.foodPrice}Rs\n")
# Method to create bill, calculate total fare of customer
def costEstimation(self):
if self.name != " ":
print("*** Final Bill *** ")
print("Customer Details")
print("Room number : ",self.roomNo)
print("Name : ",self.name)
print("Phone number : ",self.phoneNumber)
print("Address : ",self.address)
print("Check in date : ",self.inDate)
print("Check out date : ",self.outDate)
print("Total room rent : ",self.rent)
print("Total Food Cost : ",self.foodPrice)
Total = self.rent + self.foodPrice + 100
print("Your sub total purchase is : ",Total)
print("Additional service tax : ")
print("Total bill",Total + 500)
print("Thank You..Visit Again ",emoji.emojize(":grinning_face_with_big_eyes:"))
else:
print("Add customer first.")
def customerInfo(self):
for i in self.customers:
print(self.customers[i],"\n")
# Main method from where execution starts.
if __name__ == '__main__':
hotel = hotelManagement()
Continue = True
# A menucard to display all the available options.
while(Continue):
print("1. Enter customer details")
print("2. Calculate room rent")
print("3. Calculate food purchased")
print("4. Display total cost")
print("5. Customers information")
print("6. Exit")
option = int(input("Enter the option : "))
if(option == 1):
hotel.addCustomer()
elif(option == 2):
hotel.roomRent()
elif(option == 3):
hotel.foodPurchased()
elif(option == 4):
hotel.costEstimation()
elif(option == 5):
hotel.customerInfo()
elif(option == 6):
Continue = False