Advertisement
mamaneo

Finals para bukas lmao

Dec 12th, 2018
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. def reservation():
  2. print("Program: Simple Hotel Reservation\n")
  3. print("1. Print reservation list")
  4. print("2. Check if you have reservation")
  5. print("3. Add a reservation")
  6. print("4. Cancel a reservation")
  7. print("5. Quit/End.\n")
  8.  
  9. def rooms():
  10. print("Select types of room")
  11. print("1. Single: A room assigned to one person")
  12. print("2. Double: A room assigned to two people")
  13. print("3. Twin: A room with two beds. May be occupied by one or more people.")
  14. print("4. King: A room with a king-sized bed. May be occupied by one or more people.")
  15.  
  16.  
  17. reservation()
  18.  
  19. dict={"jose":"Single Room"
  20. ,"kobe":"Double Room"
  21. ,"yev":"Twin Room"
  22. ,"shayne":"Single Room"
  23. ,"burac":"King Room"
  24. }
  25.  
  26.  
  27. gender=[["jose","Male"],
  28. ["kobe","Male"],
  29. ["yev","Male"],
  30. ["shayne","Female"],
  31. ["burac","Female"]]
  32.  
  33. choice=0
  34.  
  35. while choice != 5:
  36. choice=int(input("Input number[1-5]: "))
  37. if choice == 1:
  38. for x,y in gender:
  39. print("Name:{} \tGender:{} \tTypes:{}".format(x,y,dict[x]))
  40.  
  41.  
  42. elif choice == 2:
  43. print("Checker")
  44. name=str(input("Input name: "))
  45. if name in dict:
  46. print("%s is have a reservation."%name.title())
  47.  
  48. else:
  49. print("%s is not have a reservation."%name.title())
  50.  
  51.  
  52. elif choice == 3:
  53. print("Add a reservation")
  54. name=str(input("Input name: "))
  55. user=str(input("Enter [Male], [Female]: ")).title()
  56. rooms()
  57. choice=int(input("Input number[1-4]: "))
  58. if choice == 1:
  59. dict[name]="Single Room"
  60. gender.append([name,user])
  61. print("Thank You!")
  62.  
  63. elif choice == 2:
  64. dict[name]="Double Room"
  65. gender.append([name,user])
  66. print("Thank You!")
  67.  
  68. elif choice == 3:
  69. dict[name]="Twin Room"
  70. gender.append([name,user])
  71. print("Thank You!")
  72.  
  73. elif choice == 4:
  74. dict[name]="King Room"
  75. gender.append([name,user])
  76. print("Thank You!")
  77.  
  78. else:
  79. print("Choice is not in range")
  80.  
  81.  
  82. elif choice == 4:
  83. print("Cancel a reservation")
  84. name=str(input("Input name: "))
  85. if name in dict:
  86. del dict[name]
  87. print("%s, reservation have been successfully canceled."%name.title())
  88.  
  89. else:
  90. print("%s is not in reservation list"%name.title())
  91.  
  92.  
  93. elif choice == 5:
  94. print("Thank You! <3")
  95. break
  96.  
  97.  
  98. else:
  99. reservation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement