Advertisement
kimaisa

Untitled

Nov 12th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1. class hotelfarecal:
  2.  
  3. def __init__(self,rt='',s=0,p=0,r=0,t=0,a=1800,name='',address='',cindate='',coutdate='',rno=101):
  4.  
  5. print ("\n\n*****WELCOME TO SNAPGRAPHY HOTEL*****\n")
  6.  
  7. self.rt=rt
  8.  
  9. self.r=r
  10.  
  11. self.t=t
  12.  
  13. self.p=p
  14.  
  15. self.s=s
  16. self.a=a
  17. self.name=name
  18. self.address=address
  19. self.cindate=cindate
  20. self.coutdate=coutdate
  21. self.rno=rno
  22. def inputdata(self):
  23. self.name=input("\nEnter your name:")
  24. self.address=input("\nEnter your address:")
  25. self.cindate=input("\nEnter your check in date:")
  26. self.coutdate=input("\nEnter your checkout date:")
  27. print("Your room no.:",self.rno,"\n")
  28.  
  29. def roomrent(self):#sel1353
  30.  
  31. print ("We have the following rooms for you:-")
  32.  
  33. print ("1. type A---->Shs 6000 PN\-")
  34.  
  35. print ("2. type B---->Shs 5000 PN\-")
  36.  
  37. print ("3. type C---->Shs 4000 PN\-")
  38.  
  39. print ("4. type D---->Shs 3000 PN\-")
  40.  
  41. x=int(input("Enter Your Choice Please->"))
  42.  
  43. n=int(input("For How Many Nights Did You Stay:"))
  44.  
  45. if(x==1):
  46.  
  47. print ("you have opted room type A")
  48.  
  49. self.s=6000*n
  50.  
  51. elif (x==2):
  52.  
  53. print ("you have opted room type B")
  54.  
  55. self.s=5000*n
  56.  
  57. elif (x==3):
  58.  
  59. print ("you have opted room type C")
  60.  
  61. self.s=4000*n
  62.  
  63. elif (x==4):
  64. print ("you have opted room type D")
  65.  
  66. self.s=3000*n
  67.  
  68. else:
  69.  
  70. print ("please choose a room")
  71.  
  72. print ("your room rent is =",self.s,"\n")
  73.  
  74. def restaurentbill(self):
  75.  
  76. print("*****RESTAURANT MENU*****")
  77.  
  78. print("1.water----->Shs20","2.tea----->Shs40","3.breakfast combo--->Shs90","4.lunch---->Shs220","5.dinner--->Shs550","6.Exit")
  79.  
  80.  
  81. while (1):
  82.  
  83. c=int(input("Enter your choice:"))
  84.  
  85.  
  86. if (c==1):
  87. d=int(input("Enter the quantity:"))
  88. self.r=self.r+20*d
  89.  
  90. elif (c==2):
  91. d=int(input("Enter the quantity:"))
  92. self.r=self.r+10*d
  93.  
  94. elif (c==3):
  95. d=int(input("Enter the quantity:"))
  96. self.r=self.r+90*d
  97.  
  98. elif (c==4):
  99. d=int(input("Enter the quantity:"))
  100. self.r=self.r+110*d
  101.  
  102. elif (c==5):
  103. d=int(input("Enter the quantity:"))
  104. self.r=self.r+150*d
  105.  
  106. elif (c==6):
  107. break;
  108. else:
  109. print("Invalid option")
  110.  
  111. print ("Total food Cost=Shs",self.r,"\n")
  112.  
  113. def laundrybill(self):
  114. print ("******LAUNDRY MENU*******")
  115.  
  116. print ("1.Shorts----->Shs10","2.Trousers----->Shs10","3.Shirt--->Shs15","4.Jeans---->Shs20","5.Girlsuit--->Shs12","6.Exit")
  117.  
  118. while (1):
  119. #brought to you by kimaisa-snapgraphyprojects.org
  120.  
  121. e=int(input("Enter your choice:"))
  122.  
  123. if (e==1):
  124. f=int(input("Enter the quantity:"))
  125. self.t=self.t+3*f
  126.  
  127. elif (e==2):
  128. f=int(input("Enter the quantity:"))
  129. self.t=self.t+4*f
  130.  
  131. elif (e==3):
  132. f=int(input("Enter the quantity:"))
  133. self.t=self.t+5*f
  134.  
  135. elif (e==4):
  136. f=int(input("Enter the quantity:"))
  137. self.t=self.t+6*f
  138.  
  139. elif (e==5):
  140. f=int(input("Enter the quantity:"))
  141. self.t=self.t+8*f
  142. elif (e==6):
  143. break;
  144. else:
  145.  
  146. print ("Invalid option")
  147.  
  148.  
  149. print ("Total Laundary Cost=Shs",self.t,"\n")
  150.  
  151. def gamebill(self):
  152. print ("******GAME MENU*******")
  153.  
  154. print ("1.Table tennis----->Shs60","2.Bowling----->Shs80","3.Snooker--->Shs70","4.Video games---->Shs50","5.Pool--->Shs20==6","6.Exit")
  155.  
  156.  
  157.  
  158. while (1):
  159.  
  160.  
  161. g=int(input("Enter your choice:"))
  162.  
  163.  
  164. if (g==1):
  165. h=int(input("No. of hours:"))
  166. self.p=self.p+60*h
  167.  
  168. elif (g==2):
  169. h=int(input("No. of hours:"))
  170. self.p=self.p+80*h
  171.  
  172. elif (g==3):
  173. h=int(input("No. of hours:"))
  174. self.p=self.p+70*h
  175.  
  176. elif (g==4):
  177. h=int(input("No. of hours:"))
  178. self.p=self.p+90*h
  179.  
  180. elif (g==5):
  181. h=int(input("No. of hours:"))
  182. self.p=self.p+50*h
  183. elif (g==6):
  184. break;
  185.  
  186. else:
  187.  
  188. print ("Invalid option")
  189.  
  190.  
  191.  
  192. print ("Total Game Bill=Shs",self.p,"\n")
  193.  
  194. def display(self):
  195. print ("******HOTEL BILL******")
  196. print ("Customer details:")
  197. print ("Customer name:",self.name)
  198. print ("Customer address:",self.address)
  199. print ("Check in date:",self.cindate)
  200. print ("Check out date",self.coutdate)
  201. print ("Room no.",self.rno)
  202. print ("Your Room rent is:",self.s)
  203. print ("Your Food bill is:",self.r)
  204. print ("Your laundary bill is:",self.t)
  205. print ("Your Game bill is:",self.p)
  206.  
  207. self.rt=self.s+self.t+self.p+self.r
  208.  
  209. print ("Your sub total bill is:",self.rt)
  210. print ("Additional Service Charges is",self.a)
  211. print ("Your grandtotal bill is:",self.rt+self.a,"\n")
  212. self.rno+=1
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220. def main():
  221.  
  222. a=hotelfarecal()
  223.  
  224.  
  225. while (1):
  226. print("1.Enter Customer Data")
  227.  
  228. print("2.Calculate roomrent")
  229.  
  230. print("3.Calculate restaurant bill")
  231.  
  232. print("4.Calculate laundry bill")
  233.  
  234. print("5.Calculate gamebill")
  235.  
  236. print("6.Show total cost")
  237.  
  238. print("7.EXIT")
  239.  
  240. b=int(input("\nEnter your choice:"))
  241. if (b==1):
  242. a.inputdata()
  243.  
  244. if (b==2):
  245.  
  246. a.roomrent()
  247.  
  248. if (b==3):
  249.  
  250. a.restaurentbill()
  251.  
  252. if (b==4):
  253.  
  254. a.laundrybill()
  255.  
  256. if (b==5):
  257.  
  258. a.gamebill()
  259.  
  260. if (b==6):
  261.  
  262. a.display()
  263.  
  264. if (b==7):
  265.  
  266. quit()
  267.  
  268.  
  269.  
  270. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement