Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Shea and Roses
- from random import choice #imports
- from string import ascii_uppercase
- wallet= 1000 #given amount
- def RBUK_purchase(): #Sets global for keyboard
- global wallet
- wallet=wallet-99.99
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))#Generates random id
- def RM_purchase(): #Sets global for mouse
- global wallet
- wallet=wallet-69.99
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))
- def Monitor_purchase(): #Sets global for monitor
- global wallet
- wallet=wallet-349.99
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))
- def motherboard_purchase(): #Sets global for motherboard
- global wallet
- wallet=wallet-136.99
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))
- def cpu_purchase(): #Sets global for cpu
- global wallet
- wallet=wallet-419.50
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))
- def leave():
- print "Thank you for shopping at Newegg; have a great day!"
- def gpu_purchase(): #Sets global for gpu
- global wallet
- wallet=wallet-209.99
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))
- def fan_purchase(): #Sets global for fan
- global wallet
- wallet=wallet-192.99
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))
- def case_purchase(): #Sets global for case
- global wallet
- wallet=wallet-189.99
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))
- def ssd_purchase(): #Sets global for ssd
- global wallet
- wallet=wallet-45.99
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))
- def os_purchase(): #Sets global for os
- global wallet
- wallet=wallet-100
- print "Your tansaction id is:"
- print(''.join(choice(ascii_uppercase) for i in range(12)))
- def print_wallet():
- print "Your account balance is %d!" % wallet
- def list_inventory():
- print "To purchase an item, please input the number next to it. In stock we have:\n1.Razer Blackwidow Ultimate 2016 Mechanical Gaming Keyboard for 99.99\n2.Razer DeathAddar Chroma for 69.99\n3.Acer KBlack 23.6in. 4ms (GTG) Widescreen LED Backlight LCD Monitor, IPS Panel 300 cd/m2 100,000,000:1 Built-in Speakers for 349.99\n4.GIGABYTE LGA 1150 Intel Z97 HDMI SATA 6Gb/s USB 3.0 ATX Intel Motherboard for 136.99\n5.Intel Core i7-6700K 8M Skylake Quad-Core 4.0 GHz LGA 1151 91W Desktop Processor Intel® HD Graphics 530 for 419.50\n.6.EVGA GeForce GTX 960 2GB SSC GAMING w/ACX 2.0+, Whisper Silent Cooling Graphics Card for 209.99\n7.CISCO Fan Module with Back to Front Airflow for Nexus 5596UP for 192.99\n7. IN WIN 805 GOLD / Black Aluminum / Tempered Glass ATX Mid Tower Computer Case Compatible with ATX 12V/EPS (up to 220mm) Power Supply for 189.99\n9.Patriot Blaze 2.5\" 120GB SATA III Internal Solid State Drive (SSD) for 45.99\n10.Microsoft Windows 10 Home - 64-bit - OEM for 100.00"
- buy= raw_input(">")
- if wallet>=45.99:
- if buy=="1":
- RBUK_purchase()
- print_wallet()
- welcome_screen()
- elif buy=="2":
- RM_purchase()
- print_wallet()
- welcome_screen()
- elif buy=="3":
- Monitor_purchase()
- print_wallet()
- welcome_screen()
- elif buy=="4":
- motherboard_purchase()
- print_wallet()
- welcome_screen()
- elif buy=="5":
- cpu_purchase()
- print_wallet()
- welcome_screen()
- elif buy=="6":
- gpu_purchase()
- print_wallet()
- welcome_screen()
- elif buy=="7":
- fan_purchase()
- print_wallet()
- welcome_screen()
- elif buy=="8":
- case_purchase()
- print_wallet()
- welcome_screen()
- elif buy=="9":
- ssd_purchase()
- print_wallet()
- welcome_screen()
- elif buy=="10":
- os_purchase()
- print_wallet()
- welcome_screen()
- else:
- print "You do not have enough money to purchase anything in this store, thank you for coming!"
- leave()
- allowed_users=['ADMIN']#username
- acceptedpassword=['admin']#password
- def enterusername():#username prompt
- username=raw_input("Please enter your username\n>")
- if username in allowed_users:
- print "User Reconigized"
- enterpassword()
- else:
- print "User unknown"
- enterusername()
- def enterpassword():#password prompt
- password=raw_input("Please enter password for user \'ADMIN\'\n>")
- if password in acceptedpassword:
- welcome_screen()
- else:
- print "Incorrect password, please re-enter credentials."
- enterpassword()
- def welcome_screen():
- if wallet>0:
- print "Welcome to Newegg.com! Would you like to see our inventory or exit the store?Type 1 to see our inventory, 2 to exit."
- see_or_leave=raw_input(">")
- if see_or_leave == "1":
- list_inventory()
- else:
- leave()
- else:
- print "You are in debt and must exit the store, your last order has been canceled."
- leave()
- enterusername()
Add Comment
Please, Sign In to add comment