Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def reservation():
- print("Program: Simple Hotel Reservation\n")
- print("1. Print reservation list")
- print("2. Check if you have reservation")
- print("3. Add a reservation")
- print("4. Cancel a reservation")
- print("5. Quit/End.\n")
- def rooms():
- print("Select types of room")
- print("1. Single: A room assigned to one person")
- print("2. Double: A room assigned to two people")
- print("3. Twin: A room with two beds. May be occupied by one or more people.")
- print("4. King: A room with a king-sized bed. May be occupied by one or more people.")
- reservation()
- dict={"jose":"Single Room"
- ,"kobe":"Double Room"
- ,"yev":"Twin Room"
- ,"shayne":"Single Room"
- ,"burac":"King Room"
- }
- gender=[["jose","Male"],
- ["kobe","Male"],
- ["yev","Male"],
- ["shayne","Female"],
- ["burac","Female"]]
- choice=0
- while choice != 5:
- choice=int(input("Input number[1-5]: "))
- if choice == 1:
- for x,y in gender:
- print("Name:{} \tGender:{} \tTypes:{}".format(x,y,dict[x]))
- elif choice == 2:
- print("Checker")
- name=str(input("Input name: "))
- if name in dict:
- print("%s is have a reservation."%name.title())
- else:
- print("%s is not have a reservation."%name.title())
- elif choice == 3:
- print("Add a reservation")
- name=str(input("Input name: "))
- user=str(input("Enter [Male], [Female]: ")).title()
- rooms()
- choice=int(input("Input number[1-4]: "))
- if choice == 1:
- dict[name]="Single Room"
- gender.append([name,user])
- print("Thank You!")
- elif choice == 2:
- dict[name]="Double Room"
- gender.append([name,user])
- print("Thank You!")
- elif choice == 3:
- dict[name]="Twin Room"
- gender.append([name,user])
- print("Thank You!")
- elif choice == 4:
- dict[name]="King Room"
- gender.append([name,user])
- print("Thank You!")
- else:
- print("Choice is not in range")
- elif choice == 4:
- print("Cancel a reservation")
- name=str(input("Input name: "))
- if name in dict:
- del dict[name]
- print("%s, reservation have been successfully canceled."%name.title())
- else:
- print("%s is not in reservation list"%name.title())
- elif choice == 5:
- print("Thank You! <3")
- break
- else:
- reservation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement