Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random #importing random for the trasnaction numbers
- import string
- def store():
- print "-----------------------------------------------------"
- print "Choose an option" #allowing user to choose an option
- print "1) Browse our New Products"
- print "2) logout"
- choice = raw_input(">")
- if choice == "1": #input
- print "Here are the items in our Inventory:" #prints items for sale
- print "1. Microsoft - Natural Ergonomic Keyboard 4000: $30.00"
- print "2. Logitech - M325 Wireless Optical Mouse : $15.00"
- print "3. Dell - SE2717HR 27 IPS LED FHD FreeSync Monitor: $150.00"
- print "4. Asus - ROG STRIX H270F GAMING USB 3.1 Intel Motherboard: $120 "
- print "5. Intel® - Core™ i3-6100 3.7GHz Processor: $200 "
- print "6. PNY - XLR8 NVIDIA GeForce GTX 1050 Ti 4GB GDDR5 PCI Express 3.0 Graphics Card : $500"
- print "7. Targus - Dual Fan Chill Mat Cooling System: $25"
- print "8. CORSAIR - Carbide Series ATX Mid-Tower Case: $60"
- print "9. WD - My Passport 2TB External USB 3.0 Portable Hard Drive: $70"
- print "10. ffice 365 Home, 1-year subscription, 5 PCs/Macs (Product Key Card): $100"
- #items_for_sale=['Keyboard','Mouse','Monitor','Motherboard','CPU','Graphics Card','cooling Fan','Computer Case','Hard drive','Operating Systems']
- credit=1000
- # items_for_sale=['Keyboard','Mouse','Monitor','Motherboard','CPU','Graphics Card','cooling Fan','Computer Case','Hard drive','Operating Systems']
- userInput = raw_input("Enter Item Number: ")
- if userInput == "1":
- print
- print "You have", credit-30*1.05, "left" #tells user the amount he has left with the 5% tax added on
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No'")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 1 he will order the Keyboard
- elif userInput == "2":
- print
- print "You have", credit-15*1.05,"left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No'")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 2 he will order the mouse
- elif userInput == "3":
- print
- print "You have", credit -150*1.05, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No'")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 3 he will order the monitor
- elif userInput =="4":
- print
- print "You have", credit-120*1.05, "left "
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No'")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 4 he will order the Mother board
- elif userInput =="5":
- print
- print "You have", credit-200*1.05, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No'")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 5 he will order the CPU
- elif userInput =="6":
- print
- print "You have", credit-500*1.05, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No'")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 6 he will order the Graphics Card
- elif userInput =="7":
- print
- print "You have", credit-25*1.05,'left'
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No'")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 7 he will order the cooling fan
- elif userInput =="8":
- print
- print "You have", credit-60*1.05, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No'")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 8 he will order the computer case
- elif userInput =="9":
- print
- print "You have", credit-70*1.05, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No'")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 9 he will order the hard drive
- elif userInput =="10":
- print
- print "You have", credit-100*1.05, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- goodbye = raw_input("Would you like to keep shopping? Enter 'Yes' or 'No' ")
- if goodbye == "Yes":
- store()
- elif goodbye =="No":
- print "Thank you for shopping! Check your email for shipping details."
- else:
- print "invalid input"
- #if the user enters the number 10 he will order the operating system
- def password():
- password = raw_input("password:")
- if password == "admin": #user has to enter to correct password to be logged in
- print "You are successfully logged in. Your current account balance is .. $1000 dollars"
- store()
- else:
- print "wrong password"
- print "Welcome to J's Electronics \nPlease Login Below "
- username = raw_input("Username:")
- if username == "ADMIN": #user has to enter to correct username to be logged in
- print ""
- password()
- else:
- print "Please try again (Rember Username & Passwords are case sensitive)" #user will have to try again if they enter it wrong
Add Comment
Please, Sign In to add comment