Advertisement
Guest User

Brown-Thatham Project

a guest
Jan 16th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.94 KB | None | 0 0
  1. import random
  2.  
  3.  
  4. print "Welcome to Remote Access Mainframe T-8999 - Please enter login"
  5. print "-----------------------------------------"
  6.  
  7. allowed_users = ["admin"]
  8. password = ["admin"]
  9. username = raw_input("Please enter your username")
  10. if username in allowed_users:#checks if the input is included in the array
  11.   xyz = raw_input("enter your password")#makes person input password after determining correct username
  12.   if xyz in password: #checks if password is in the array
  13.     print "Access Granted"
  14.     print """Welcome to US ARMY DEPOT 8872, Commander.  You have 1000 dollars in your balance. Spend it wisely... """
  15.   else:
  16.       print "Access Denied"
  17.       print "Wrong Password, restart system"
  18.       exit()
  19. else:
  20.   print "Access Denied"
  21.   print "Restart the system"
  22.   exit ()
  23.  
  24.  
  25.  
  26. rofl = 2 #comes into play later when exiting
  27. cash = 1000 #total cash
  28.  
  29. pc_parts = ['AMD 8350 8 Core Processor' , 'Asus Sabertooth Motherboard AM3+ Socket', 'Noctua Nh-D15 CPU Cooler','Corsair Vengeance 8 GB RAM', 'Samsung 840 SSD 120GB', 'Nvidia GTX 960 GPU','Fractal Design R4 Black Case','Microsoft Windows 7 Home Premium','Logitech G600 MMO Gaming Mouse','Razer Ultimate BlackWidow','Asus VS247H-P 23.6 Monitor']
  30. prices_parts = [165, 175, 89 , 42 , 75 , 185 , 70 , 200 , 80 , 100, 111]
  31. #arrays for the merch
  32.  
  33.  
  34. def pcparts ():
  35.   print" \n1.) Amd 8350: 165$\n2.)Motherboard: 175$\n 3.)Noctua Cooler: 89$\n 4.)Corsair RAM: 42$\n 5.)120 GBSSD: 75$\n 6.)Nvidia 960 GPU: 185$\n 7.)Fractal Case 70\n 8.)Windows 7 OEM 200$\n 9.)Logitech G600 Mouse 80$\n 10.)Razer BlackWidow 100$\n 11.) ASUS Monitor 111$\n"
  36.  
  37. def buy(cash): #overall function to purchase games, triggered by an if statement
  38.  input2 = raw_input("Choose a part: \n1.) Amd 8350: 165$\n2.)Motherboard: 175$\n 3.)Noctua Cooler: 89$\n 4.)Corsair RAM: 42$\n 5.)120 GBSSD: 75$\n 6.)Nvidia 960 GPU: 185$\n 7.)Fractal Case 70\n 8.)Windows 7 OEM 200$\n 9.)Logitech G600 Mouse 80$\n 10.)Razer BlackWidow 100$\n 11.) ASUS Monitor 111$\n")
  39.  purchase = int(input2) #people put in an interger to determine the games outlined in input2
  40.  if input2 == '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9' or '10' or '11':
  41.      print 'My [insert family member] does not like that brand, sure wanna to purchase %s for %d dollars plus taxes and shipping?' %(pc_parts[purchase - 1], prices_parts[purchase - 1])
  42.      print "You are being taxed 7% for this product, plus a $8 shipping and handling fee on every product this totals to: "
  43.      print  prices_parts[purchase - 1] + purchase * 0.07 + 8
  44.      print "My point still stands , yes or no?"
  45.      authentication = raw_input() #final confirmn for the game
  46.      if authentication == 'yes': #if yes
  47.         if cash >= prices_parts[purchase -1]: #Inequality to determine if you have enough cash
  48.           cash = cash - prices_parts[purchase - 1] + purchase * 0.07 + 8 #purchase denotes the game , and we are subtracting the game from the list  + 0.07 taxes and shipping
  49.           a= random.choice("ABCD")*3 ##barcode
  50.           b= random.choice("FGHJKLA")*2
  51.           c= random.choice("123456789")*2
  52.           d= random.choice("ZXCIOPRTG")*2
  53.           print a + b + c + d , "This is your Part's Barcode" #adds up barcode
  54.         else:
  55.           print "You are broke, you cannot buy this part" #if one is down on money
  56.      elif authentication == 'no':
  57.         print "Look around bro, my [insert family member] is always right man!" #if one says no
  58.  
  59.  return cash #states the new cash after the purchase
  60.  
  61. while rofl == 2:
  62.     print '\nWelcome , You have %d$ on you' %cash #states cash
  63.     choice = raw_input('\nHey Wanna look at our PARTS, PURCHASE, or LEAVE?!')
  64.     if choice == 'parts': #choices are listed above.
  65.       pcparts() #triggers and prints function
  66.     elif choice == 'purchase':
  67.       cash = buy(cash) #triggers the function
  68.     elif choice == 'leave':
  69.       print 'Goodbye and I hope you had a great experience!'
  70.       rofl = 3 #rofl used to change variable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement