MCPcopy Create free account
hub / github.com/geekcomputers/Python / add

Function add

Hotel-Management.py:23–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def add():
24 Name1 = input("\nEnter your first name: \n")
25 Name2 = input("\nEnter your last name: \n")
26 Phone_Num = input("\nEnter your phone number(without +91): \n")
27
28 print("These are the rooms that are currently available")
29 print("1-Normal (500/Day)")
30 print("2-Deluxe (1000/Day)")
31 print("3-Super Deluxe (1500/Day)")
32 print("4-Premium Deluxe (2000/Day)")
33
34 Room_Type = int(input("\nWhich type you want(1-4): \n"))
35
36 match Room_Type:
37 case 1:
38 x = 500
39 Room_Type = "Normal"
40 case 2:
41 x = 1000
42 Room_Type = "Deluxe"
43 case 3:
44 x = 1500
45 Room_Type = "Super Deluxe"
46 case 4:
47 x = 2000
48 Room_Type = "Premium"
49
50 Days = int(input("How many days you will stay: "))
51 Money = x * Days
52 Money = str(Money)
53 print("")
54
55 print("You have to pay ", (Money))
56 print("")
57
58 Payment = input("Mode of payment(Card/Cash/Online): ").capitalize()
59 if Payment == "Card":
60 print("Payment with card")
61 elif Payment == "Cash":
62 print("Payment with cash")
63 elif Payment == "Online":
64 print("Online payment")
65 print("")
66
67 with open("Management.txt", "r") as File:
68 string = File.read()
69 string = string.replace("'", '"')
70 dictionary = json.loads(string)
71
72 if len(dictionary.get("Room")) == 0:
73 Room_num = "501"
74 else:
75 listt = dictionary.get("Room")
76 tempp = len(listt) - 1
77 temppp = int(listt[tempp])
78 Room_num = 1 + temppp
79 Room_num = str(Room_num)
80

Callers 1

menuFunction · 0.70

Calls 3

exit_menuFunction · 0.85
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected