Advertisement
mrScarlett

pre release cottage

Oct 1st, 2018
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.93 KB | None | 0 0
  1. house=["one", "two","three"]
  2. capacity=[4, 4,4]
  3. peak=[200, 200,100]
  4. offPeak=[50, 60,80]
  5. capacity=[4,4,4]
  6. availableOne=[2,3,4,5,6,7,8,9]
  7. availableTwo=[2,3,4,5,6,7,8,9]
  8. availableThree=[2,3,4,5,6,7,8,9]
  9. found=False
  10.  
  11. cost=0
  12. bookingCode=0
  13. bookingsCode=[]
  14. bookingsCabin=[]
  15. while (True):
  16.     choice = input("Enter house choice")
  17.     print("weeks available")
  18.     if choice=="one":
  19.         indMarker=0
  20.         for x in range (len(availableOne)):
  21.             print (availableOne[x])
  22.         chooseWeek=int(input("Choose a week to book"))
  23.         for x in range (len(availableOne)):
  24.             if chooseWeek==availableOne[x] and chooseWeek!=0:
  25.                 print ("Week available")
  26.                 if chooseWeek>=2 and chooseWeek<=5:
  27.                     cost+=peak[indMarker]
  28.                 else:
  29.                     cost+=offPeak[indMarker]
  30.                 availableOne[x]=0
  31.                 bookingsCode.append(bookingCode)
  32.                 bookingsCabin.append("one")
  33.                 found=True
  34.                 break
  35.             else:
  36.                 found=False
  37.         if found==False:
  38.             print ("Week NOT available")
  39.     if choice=="two":
  40.         indMarker=1
  41.         for x in range (len(availableTwo)):
  42.             print (availableTwo[x])
  43.         chooseWeek=int(input("Choose a week to book"))
  44.         for x in range (len(availableTwo)):
  45.             if chooseWeek==availableTwo[x] and chooseWeek!=0:
  46.                 print ("Week available")
  47.                 if chooseWeek>=2 and chooseWeek<=5:
  48.                     cost+=peak[indMarker]
  49.                 else:
  50.                     cost+=offPeak[indMarker]
  51.                 availableTwo[x]=0
  52.                 bookingsCode.append(bookingCode)
  53.                 bookingsCabin.append("two")
  54.                 found=True
  55.                 break
  56.             else:
  57.                 found=False
  58.         if found==False:
  59.             print ("Week NOT available")
  60.  
  61.     if choice=="three":
  62.         indMarker=2
  63.         for x in range (len(availableThree)):
  64.             print (availableThree[x])
  65.         chooseWeek=int(input("Choose a week to book"))
  66.         for x in range (len(availableThree)):
  67.             if chooseWeek==availableThree[x] and chooseWeek!=0:
  68.                 print ("Week available")
  69.                 if chooseWeek>=2 and chooseWeek<=5:
  70.                     cost+=peak[indMarker]
  71.                 else:
  72.                     cost+=offPeak[indMarker]
  73.                 availableThree[x]=0
  74.                 bookingsCode.append(bookingCode)
  75.                 bookingsCabin.append("three")
  76.                 found=True
  77.                 break
  78.             else:
  79.                 found=False
  80.         if found==False:
  81.             print ("Week NOT available")
  82.     anotherStay=input("Book another stay? N to quit")
  83.     if anotherStay=="N":
  84.         bookingCode+=1
  85.         break
  86.    
  87. print("Total Cost is",cost)
  88.    
  89. print(bookingsCode)
  90. print(bookingsCabin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement