Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Andrew Coyne and Alexander Agbulos
- import math
- import random
- print "----------------------------"
- print "Welcome to MAGNUS COMPUTERS!"
- print "----------------------------"
- print "Login Information Required"
- #Login Info
- person= ['ADMIN']
- password1 = ['admin']
- b = 1000
- b = int(b)
- t = 0
- s = 0
- t = int(t)
- s = int(s)
- bought = []
- it = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
- def uspa():#function for Login
- us = raw_input('USERNAME:')
- if us == person[0]:
- pa = raw_input('PASSWORD:')
- if pa == password1[0]:
- print '\n\t\t*ACCESS GRANTED*'
- else:
- print ('Incorrect... Your Connection is Terminated\n') * 100
- exit()
- else: #if incorrect, no admittance
- print ('Incorrect... Your Connection is Terminated\n') * 100
- exit()
- uspa()
- def store(): #function
- global bought
- global s
- global t
- global b
- global it
- print """Inventory:
- 1) Logitech Wireless Keyboard K360: $23.99
- 2) HP Wireless Mouse X3000: $7.99
- 3) Acer G226HQL 21.5-Inch Screen LED Monitor: $99.99
- 4) Micro ATX Motherboard GA-78LMT-USB3: $58.99
- 5) Intel Core BX80646I74790K i7-4790K Processor (8M Cache, up to 4.40 GHz): $338.15
- 6) MSI R7 370 GAMING 4G Graphics Card: $209.99
- 7) ARCTIC F8 PWM PST CO - 80mm Dual Ball Bearing Low Noise PWM Standard Case Fan with PST Feature: $9.99
- 8) Corsair Carbide Series 100R Mid Tower Case CC-9011075-WW: $48.99
- 9) WD Blue 1TB Desktop Hard Disk Drive - 7200 RPM SATA 6 Gb/s 64MB Cache 3.5 Inch:$54.99
- 10) Microsoft Windows 10 Home OS: $119.00
- ======================================================
- *All Purchase come with a .07% Tax and a $7 Shipping Fee*
- *Type 'leave' to leave*
- ======================================================
- """ #
- while b > 13.55:
- a = raw_input('Type The Number of Item You Would Like to Purchase:\n')
- if b > 30.67 and a== it[0]:
- b -= 23.99 + (23.99 * .07) + 5
- bought.append('Logitech Wireless Keyboard K360') #adds to the list
- t += 23.99 * .07 #cost of item and tax
- s += 5 #shipping cost
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice#from string, sets up Transaction ID
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif b > 13.55 and a == it[1]:
- b -= 7.99 + (7.99 * .07) + 5
- bought.append('HP Wireless Mouse X3000: $7.99')
- t += 7.99 * .07 #item cost and tax
- s += 5 #shipping fee
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice#transaction ID
- from string import ascii_uppercase
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif b > 111.99 and a == it[2]:
- b -= 99.99 + (99.99 * .07) + 5
- bought.append('Acer G226HQL 21.5-Inch Screen LED Monitor') #add to the list of purchases
- t += 99.99 * .07 #tax included #this repeats for the rest of the items
- s += 5 #shipping fee #process repeats for the rest of the items
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice #set up Transaction ID #repeat #process repeats for rest of the items
- from string import ascii_uppercase
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif b > 68.12 and a == it[3]:
- b -= 58.99 + (58.99 * .07) + 5
- bought.append('Micro ATX Motherboard GA-78LMT-USB3: $58.99')
- t += 58.99 * .07
- s += 5
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice
- from string import ascii_uppercase
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif b > 366.82 and a== it[4]:
- b -= 338.15 + (338.15 * .07) + 5
- bought.append('Intel Core BX80646I74790K i7-4790K Processor (8M Cache, up to 4.40 GHz)')
- t += 338.15 * .07
- s += 5
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice
- from string import ascii_uppercase
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif b > 229.69 and a== it[5]:
- b -= 209.99 + (209.99 * .07) + 5
- bought.append('MSI R7 370 GAMING 4G Graphics Card')
- t += 209.99 * .07
- s += 5
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice
- from string import ascii_uppercase
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif b > 111.99 and a== it[6]:
- b -= 99.99 + (99.99 * .07) + 5
- bought.append('ARCTIC F8 PWM PST CO - 80mm Dual Ball Bearing Low Noise PWM Standard Case Fan with PST Feature')
- t += 99.99 * .07
- s += 5
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice
- from string import ascii_uppercase
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif b > 57.42 and a == it[7]:
- b -= 48.99 + (48.99 * .07) + 5
- bought.append('Corsair Carbide Series 100R Mid Tower Case CC-9011075-WW')
- t += 48.99 * .07
- s += 5
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice
- from string import ascii_uppercase
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif b > 63.84 and a == it[8]:
- b -= 54.99 + (54.99 * .07) + 5
- bought.append('WD Blue 1TB Desktop Hard Disk Drive - 7200 RPM SATA 6 Gb/s 64MB Cache 3.5 Inch')
- t += 54.99 * .07
- s += 5
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice
- from string import ascii_uppercase
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif b > 133.32 and a == it[9]:
- b -= 119.99 + (119.00 * .07) + 5
- bought.append('Microsoft Windows 10 Home OS: 119.00')
- t += 119.00 * .07
- s += 5
- print ('Your Balance is $%.2f ' % b)
- print 'Item Number:'
- from random import choice
- from string import ascii_uppercase
- print(''.join(choice('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789') for i in range(12)))
- elif a == 'leave':
- print """
- BYE
- .-. _
- | | / )
- | |/ /
- _|__ /_
- / __)-' )
- \ `(.-')
- > ._>-'
- / \/
- """
- print "Try Again"
- print 'You bought: %s' %(bought)
- print 'Grand total in Tax: $%.2f' %t
- print 'Grand total in Shiping: $%d' %s
- print 'Grand total: $%d' % tot
- exit()
- else:
- print "You either don't have enough money for the item or what you wrote is not a command"
- store()
- total_cost = int(1000 - b)
- print '\n\nInsufficent Funds :(\n'#calculates costs
- print 'You bought: %s' %(bought)
- print '\nGrand total in Tax: $%.2f' %t #total tax costs
- print 'Grand total in Shipping: $%d' %s #total costs shipping
- print 'Grand total: $%d' % total_cost #grand total
- print """
- THANKS FOR SHOPPING
- .-. _
- | | / )
- | |/ /
- _|__ /_
- / __)-' )
- \ `(.-')
- > ._>-'
- / \/
- """
Add Comment
Please, Sign In to add comment