Skip to content

Commit

Permalink
add python files
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezoa committed Jul 22, 2010
0 parents commit 2e3ef0c
Show file tree
Hide file tree
Showing 15 changed files with 527 additions and 0 deletions.
92 changes: 92 additions & 0 deletions python/concession.py
@@ -0,0 +1,92 @@
#Created by Kyle Cheung- July 8, 2010. Licensed under the MIT/X11 license: http://www.opensource.org/licenses/mit-license.php

#Meh, the outrageous prices of movie concessions

print("\nHi, how many I help you rip you off on expensive beverages and popcorn?\n")

#because I can't for the life of me find out how to do multi-line print statements

##FIRST MENU-- POPCORN SIZE
#This is the first choice menu for the size of popcorn. It will declare the variable popcornPrice to use for total price.
askPopcornSize = '''What size popcorn do you want?
Press 1 for Small
Press 2 for Medium
Press 3 for Large
Press 4 for Artery-clogging X-Large
'''
print(askPopcornSize)

#The user inputs their number, gets changed into an integer and matches up with appropriate variable number. The popcornPrice variable will be used later to determine final price.
popcornSize = int(input("Please select your number: "))
if popcornSize == 1:
popcornPrice = 4.75
print('You have chosen the small sized popcorn.')
if popcornSize == 2:
popcornPrice = 5.75
print('You have chosen the medium sized popcorn.')
if popcornSize == 3:
popcornPrice = 6.75
print('You have chosen the large sized popcorn.')
if popcornSize == 4:
popcornPrice = 10.75
print('You have chosen the artery-clogging, x-large sized popcorn. Menial insurance protection is included with this purchase.')

#SECOND MENU-- BEVERAGES
#This is the second choice menu for beverages. In this instance they don't contain second depth menus... yet.

askBeverage = '''\nWhich beverage would you like?
Press 1 for a Small Coke (no diet for you woosies)
Press 2 for a Medium Coke
Press 3 for a Large Coke
Press 4 for an X-Large Coke
Press 5 for a Small 7-Up
Press 6 for a Medium 7-Up
Press 7 for a Large 7-Up
Press 8 for a X-Large 7-Up
Press 9 for your 7-11 GULP Slurpy
Press 10 for bottled water which is worse than tap water.. Aquafina'''
print(askBeverage)

#User inputs number, blahblahblah, you get the picture from the first prompt.
beverage = int(input("Please select your number: "))
#coke mania
if beverage == 1:
beveragePrice = 3.25
print('You have chosen the small coke.')
if beverage == 2:
beveragePrice = 3.75
print('You have chosen the medium coke.')
if beverage == 3:
beveragePrice = 4.25
print('You have chosen the large coke.')
if beverage == 4:
beveragePrice = 4.75
print("You have chosen the x-large coke. Please don't burp a lot while watching in the movie. Thanks.")
#7-up mania
if beverage == 5:
beveragePrice = 3
print('You have chosen the small 7-up.')
if beverage == 6:
beveragePrice = 3.25
print('You have chosen the medium 7-up.')
if beverage == 7:
beveragePrice = 3.75
print('You have chosen the large 7-up.')
if beverage == 8:
beveragePrice = 4.00
print('You have chosen the x-large 7-up.')
#and the other beverages
if beverage == 9:
beveragePrice = 4
print('You have chosen the slurpy. Slurp steathily.')
if beverage == 10:
beveragePrice = 8
print('You have chosen Aquafina. Very bad choice.')

#sneaky prices
tax = (popcornSize + beveragePrice) * 0.0925
surcharge = 2

print('\nThe popcorn cost $', popcornSize, 'and your beverage cost $', beveragePrice, 'with a tax of $', tax, '. Your final total including a $2.00 surcharge is, $', (popcornSize + beveragePrice + tax + surcharge),'. Thanks for purchasing your grub here!')

#and that's your average concession stand ladies and gentlemen!
38 changes: 38 additions & 0 deletions python/concession_datastructure.py
@@ -0,0 +1,38 @@
#Created by Kyle Cheung with help from "CaZe" Licensed under the MIT/X11 license: http://www.opensource.org/licenses/mit-license.php

#Meh, the outrageous prices of movie concessions

#price and size list
sizes = ['small', 'medium', 'large', 'x-large']
pricePopcorn = [4.75, 5.75, 6.75, 10.75]
priceCoke = [3.25, 3.75, 4.25, 4.75]
price7up = [3, 3.25, 3.75, 4]

#standard function list
def inputSelection():
return int(input("Please enter the number of your selection: "))

def printInvalidSelection():
print('You have entered an invalid number, please enter a correct number.')

#standardized ask size
def askSize(product, priceList):
print('What size would you like with that,' + product +,'?\n')

#Press <#> for the <size> <product>
for i in range(len(sizes))
print('Press' + str(i + 1) + 'for the' + sizes[i] + 'size ($' + str(priceList[i]) + ')')

selection = inputSelection()

if (selection > len(sizes)) or (selection < 1):
return 0
else:
print('You have selected the ' + sizes[input - 1] + product + '.')
return pricelist[input - 1]

print("\nHi, how many I help you rip you off on expensive beverages and popcorn?\n")

popcornPrice = size('popcorn', pricePopcorn)


144 changes: 144 additions & 0 deletions python/concessiondetailed.py
@@ -0,0 +1,144 @@
#Created by Kyle Cheung- July 8, 2010. Licensed under the MIT/X11 license: http://www.opensource.org/licenses/mit-license.php

#Meh, the outrageous prices of movie concessions

print("\nHi, how many I help you rip you off on expensive beverages and popcorn?\n")

#because I can't for the life of me find out how to do multi-line print statements

def inputSelection():
return int(input("Please enter the number of your selection: "))

def printInvalidSelection():
print('You have entered an invalid number, please enter a correct number.')

##FIRST MENU-- POPCORN SIZE
#This is the first choice menu for the size of popcorn. It will declare the variable popcornPrice to use for total price.
askPopcornSize = '''What size popcorn do you want?
Press 1 for Small
Press 2 for Medium
Press 3 for Large
Press 4 for Artery-clogging X-Large
'''
print(askPopcornSize)

#The user inputs their number, gets changed into an integer and matches up with appropriate variable number. If no proper variable is used it goes back up to the while loop. The popcornPrice variable will be used later to determine final price.

while True:
popcornSize = inputSelection()

if popcornSize == 1:
popcornPrice = 4.75
print('You have chosen the small sized popcorn.')
break
if popcornSize == 2:
popcornPrice = 5.75
print('You have chosen the medium sized popcorn.')
break
if popcornSize == 3:
popcornPrice = 6.75
print('You have chosen the large sized popcorn.')
break
if popcornSize == 4:
popcornPrice = 10.75
print('You have chosen the artery-clogging, x-large sized popcorn. Menial insurance protection is included with this purchase.')
break
else:
printInvalidSelection()
continue


#SECOND MENU -- GENERAL BEVERAGE -> SIZE

askGeneralBeverage = '''\nWhat beverage would you like?
Press 1 for Coke (no diet for you woosies)
Press 2 for 7-Up
Press 3 for 7-11 GULP Slurpy ($4.00)
Press 4 for bottled water which is worse than tap water.. Aquafina ($8.00)\n'''

print(askGeneralBeverage)

#User inputs number, goes to more indepth menus to get proper beverage size.

beverageGeneral = inputSelection()

#coke mania
while beverageGeneral == 1:
askBeverageSizeCoke = '''\nWhich size would you like for that Coke?
Press 1 for the small size ($3.25)
Press 2 for the medium size ($3.75)
Press 3 for the large size ($4.25)
Press 4 for the x-large size ($4.75)\n'''

print(askBeverageSizeCoke)

beverageSize = inputSelection()

if beverageSize == 1:
beveragePrice = 3.25
print('You have selected the small size Coke.')
break
if beverageSize == 2:
beveragePrice = 3.75
print('You have selected the medium size Coke.')
break
if beverageSize == 3:
beveragePrice = 4.25
print('You have selected the large size Coke.')
break
if beverageSize == 4:
beveragePrice = 4.75
print('You have selected the x-large size Coke. Please burp responsibly.')
break
else:
printInvalidSelection()
continue

#7-up mania
while beverageGeneral == 2:
askBeverageSize7up = '''\nWhich size would you like for that 7-up?
Press 1 for the small size ($3.00)
Press 2 for the medium size ($3.25)
Press 3 for the large size ($3.75)
Press 4 for the x-large size ($4.05)\n'''
print(askBeverageSize7up)

beverageSize = inputSelection()

if beverageSize == 1:
beveragePrice = 3
print('You have chosen the small size 7-up.')
break
if beverageSize == 2:
beveragePrice = 3.25
print('You have chosen the medium size 7-up.')
break
if beverageSize == 3:
beveragePrice = 3.75
print('You have chosen the large size 7-up.')
break
if beverageSize == 4:
beveragePrice = 4.05
print('You have chosen the x-large size 7-up.')
break
else:
printInvalidSelection()
continue

#slurpy
if beverageGeneral == 3:
beveragePrice = 4
print('You have chosen the slurpy. Slurp steathily.')

#aquafina
if beverageGeneral == 4:
beveragePrice = 8
print('You have chosen Aquafina. Very bad choice. You know how much plastic goes into these bottles?')

#sneaky prices
tax = (popcornPrice + beveragePrice) * 0.0925
surcharge = 2

print('\nThe popcorn cost $', popcornPrice, 'and your beverage cost $', beveragePrice, 'with a tax of $', tax, '. Your final total including a $2.00 surcharge is, $', (popcornPrice + beveragePrice + tax + surcharge),'. Thanks for purchasing your grub here!')

#and that's your average concession stand ladies and gentlemen!

0 comments on commit 2e3ef0c

Please sign in to comment.