Last active
July 25, 2017 14:26
-
-
Save spa1mer/5eba249124d1a237d4adb88395659298 to your computer and use it in GitHub Desktop.
SlinginZystem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('Welcome to SlangingZah!!!') | |
# Employee ID Numbers | |
employee_IDs = {'Sam': 407427, | |
'Bart': 101026, | |
'Mike': 445002, | |
} | |
employee_number = int(input('Employee ID: ')) | |
# Employee Login Screen | |
if employee_number not in employee_IDs.values(): | |
print('Invalid employee ID') | |
# Begin code | |
else: | |
import time | |
print('Logging into SlinginZystem...') | |
time.sleep(2) | |
print('{:''^100}'.format('')) # Adds space in between lines | |
def customer(name, address, phone_number): #Customer Input | |
print('{:-^100}'.format('')) | |
name = input('Order Name: ') | |
address = input('Order Address: ') | |
phone_number = input('Order Phone Number: ') | |
print('{:-^100}'.format('')) | |
print('{:' '^100}'.format('')) # Adds space in between lines | |
# print('Hello', name,'!!! What would you like to order?') | |
def wait(t): | |
for i in range(0, t): | |
i = i + 0 | |
def orderScreen(s): # Shows menu | |
welcome = ' SlinginZah Menu ' | |
instruct = '[P = Pay] [Q = Quit] | Please select an item.' # Instructions | |
print('{:' '^100}'.format(welcome)) | |
print('{:' '^100}'.format('')) | |
for key in pizza_menu.keys(): | |
print(key, pizza_menu[key]) | |
print('{:' '^100}'.format('')) | |
print('{: ^100}'.format(instruct)) | |
print('{:' '^100}'.format('')) | |
def takeOrder(s): # Get the customer's order | |
d = '' | |
size = '' | |
order = [] | |
customer(name=True, address=True, phone_number=True) | |
orderScreen(pizza_prices) | |
while str.upper(d) != 'P': # Loop until customer decides to pay. | |
if str.upper(d) == 'Q': # Break loop to quit. | |
break | |
elif: | |
d = input('Type Pizza Name --> ') | |
if str.upper(d) != 'P': | |
size = input('{:' '>40}'.format('Small, Medium, or Large? --> ')) | |
print('{:-^100}'.format(size + ' ' + d)) | |
print('{:' '^100}'.format('')) | |
for key in s.keys(): | |
if key == str.capitalize(d): | |
order.append(str.capitalize(d)) | |
if str.upper(d) == "P": | |
acceptPayment(order, pizza_prices) # Call acceptPayment | |
return d # Return to main program. | |
def acceptPayment(o, s): | |
import time | |
header = " Check Out " | |
prompt = u'{: >50}'.format('Amount Given: $') | |
subtotal = 0.00 | |
tax = 0.06 | |
given = 0.00 | |
change = 0.00 | |
large = 3.00 | |
medium = 2.00 | |
for i in range(0, len(o)): # Calculate total due. | |
for key in s.keys(): | |
if o[i] == key: | |
subtotal = subtotal + s[key] | |
tax = subtotal*tax | |
total = subtotal + tax | |
print('{:-^100}'.format(header)) # Print order and amount due. | |
for i in range(0, len(o)): | |
pizza = o[i] | |
price = s[o[i]] | |
print('{: >48} ${: <39.2f}'.format(pizza, price)) | |
print('{:' '^100}'.format('')) | |
print(u'{: >50}{: <49.2f}'.format('Subtotal: $', subtotal)) | |
print(u'{: >50}{: <49.2f}'.format('Tax: $', tax)) | |
print(u'{: >50}{: <49.2f}'.format('Total: $', total)) | |
given = float(input(prompt)) # Amount given. | |
if given >= total: # Calculate change due. | |
change = given - total | |
print(u'{: >50}{: <39.2f}'.format('Change Due: $', change)) | |
else: | |
print('{:' '^100}'.format('')) | |
print("{: ^100}".format('!!!!! No Monies, No Zah !!!!!')) | |
time.sleep(3) | |
# Global variables. | |
pizza_menu = { | |
'El Jefe ':'- All the Meats, Onions, Ashes of Problem Employees, Special pizza sauce', | |
'OMV ':'- All the Meats, Haribo Gummy Bears, Chopped Chicken Tendies, Special pizza sauce', | |
'Dirty Hipster ':'- Microbrew Infused Tofu, Organic Green Tea Leaves, Lama Cheese, Special pizza sauce', | |
} | |
pizza_prices = { | |
'Jefe': 12.99, | |
'Vaden': 13.99, | |
'Dirty': 14.99, | |
} | |
# Main Program | |
d = '' | |
while str.upper(d) != 'Q': | |
d = takeOrder(pizza_prices) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment