Advertisement
Guest User

Final Project - Justin White

a guest
Jan 11th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.63 KB | None | 0 0
  1. import random
  2. import string
  3. print "Welcome to J's Electronics \nPlease Login Below "
  4. while True:#welcoms the user
  5. username = raw_input('Username:')
  6. print "Welcome to our shop",username.upper()
  7. break
  8. while True:
  9. password = raw_input('Password:')
  10. print "You are successfully logged in"
  11. break
  12.  
  13. print "1)Browse our New Products 2)Logout"
  14. answer=True#aska what the user wants to do
  15. while answer:
  16. question = int(input("What would you like to do?"))
  17. if question == 1:
  18. break
  19. elif question ==2:
  20. print("Have a nice day ")
  21. exit()
  22.  
  23.  
  24. def items():#prints the list
  25. print"""
  26. Hello User. Your current account balance is .. $1000 dollars
  27. Top selling Items
  28. 1) Microsoft - Natural Ergonomic Keyboard 4000
  29. 2) Logitech - M325 Wireless Optical Mouse
  30. 3) Dell - SE2717HR 27" IPS LED FHD FreeSync Monitor
  31. 4) Asus - ROG STRIX H270F GAMING USB 3.1 Intel Motherboard
  32. 5) Intel® - Core™ i3-6100 3.7GHz Processor
  33. 6) PNY - XLR8 NVIDIA GeForce GTX 1050 Ti 4GB GDDR5 PCI Express 3.0 Graphics Card
  34. 7) Targus - Dual Fan Chill Mat Cooling System
  35. 8) CORSAIR - Carbide Series ATX Mid-Tower Case
  36. 9) WD - My Passport 2TB External USB 3.0 Portable Hard Drive
  37. 10) Office 365 Home, 1-year subscription, 5 PCs/Macs (Product Key Card)
  38. """
  39.  
  40. items()
  41. items_for_sale=['Microsoft - Natural Ergonomic Keyboard 4000','Logitech - M325 Wireless Optical Mouse ','Dell - SE2717HR 27" IPS LED FHD FreeSync Monitor','Asus - ROG STRIX H270F GAMING USB 3.1 Intel Motherboard','Intel® - Core™ i3-6100 3.7GHz Processor','PNY - XLR8 NVIDIA GeForce GTX 1050 Ti 4GB GDDR5 PCI Express 3.0 Graphics Card ','Targus - Dual Fan Chill Mat Cooling System','CORSAIR - Carbide Series ATX Mid-Tower Case','WD - My Passport 2TB External USB 3.0 Portable Hard Drive','Office 365 Home, 1-year subscription, 5 PCs/Macs (Product Key Card)']
  42. credit=1000
  43. while True:
  44. items_for_sale=['Microsoft - Natural Ergonomic Keyboard 4000','Logitech - M325 Wireless Optical Mouse ','Dell - SE2717HR 27" IPS LED FHD FreeSync Monitor','Asus - ROG STRIX H270F GAMING USB 3.1 Intel Motherboard','Intel® - Core™ i3-6100 3.7GHz Processor','PNY - XLR8 NVIDIA GeForce GTX 1050 Ti 4GB GDDR5 PCI Express 3.0 Graphics Card ','Targus - Dual Fan Chill Mat Cooling System','CORSAIR - Carbide Series ATX Mid-Tower Case','WD - My Passport 2TB External USB 3.0 Portable Hard Drive','Office 365 Home, 1-year subscription, 5 PCs/Macs (Product Key Card)']
  45. userInput = int(raw_input("Enter Item Number:"))
  46. if userInput == 1:
  47. print items_for_sale[0]
  48. print "You have", credit-10, "left"
  49. print "Transaction ID:",''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  50. #if the user puts in 1 he will order the Microsoft - Natural Ergonomic Keyboard 4000
  51. elif userInput == 2:
  52. print items_for_sale[1]
  53. print "You have", credit-20,"left"
  54. print "Transaction ID:",''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  55. #if the user puts in 2 he will order the Logitech - M325 Wireless Optical Mouse
  56. elif userInput == 3:
  57. print items_for_sale[2]
  58. print "You have", credit -100, "left"
  59. print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  60. #if the user puts in 3 he will order the Dell - SE2717HR 27" IPS LED FHD FreeSync Monitor
  61. elif userInput ==4:
  62. print items_for_sale[3]
  63. print "You have", credit-150, "left "
  64. print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  65. #if the user puts in 4 he will order the Asus - ROG STRIX H270F GAMING USB 3.1 Intel Motherboard
  66. elif userInput ==5:
  67. print items_for_sale[4]
  68. print "You have", credit-500, "left"
  69. print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  70. #if the user puts in 5 he order the Intel® - Core™ i3-6100 3.7GHz Processor
  71. elif userInput ==6:
  72. print items_for_sale[5]
  73. print "You have", credit-40, "left"
  74. print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  75. #if the user puts in 6 he will order PNY - XLR8 NVIDIA GeForce GTX 1050 Ti 4GB GDDR5 PCI Express 3.0 Graphics Card
  76. elif userInput ==7:
  77. print items_for_sale[6]
  78. print "You have", credit-190,'left'
  79. print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  80. #if the user puts in 7 order a Targus - Dual Fan Chill Mat Cooling System
  81. elif userInput ==8:
  82. print items_for_sale[7]
  83. print "You have", credit-20, "left"
  84. print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  85. #if the user puts in 8 they will order a CORSAIR - Carbide Series ATX Mid-Tower Case
  86. elif userInput ==9:
  87. print items_for_sale[8]
  88. print "You have", credit-90, "left"
  89. print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  90. #if the user puts in 9 they order a WD - My Passport 2TB External USB 3.0 Portable Hard Drive
  91. elif userInput ==10:
  92. print items_for_sale[9]
  93. print "You have", credit-220, "left"
  94. print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
  95. #if the user puts in 10 they will order Office 365 Home, 1-year subscription, 5 PCs/Macs (Product Key Card)
  96. final_question=int(input("Would you like keep shopping? 1)Yes 2)No"))
  97. if final_question == 1:
  98. print("Choose Your Next Item")
  99. continue
  100. elif final_question ==2:
  101. print("Thank you for shopping! Check your email for shipping details.")
  102. exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement