-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion2: customer details
29 lines (23 loc) · 1003 Bytes
/
version2: customer details
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# version2.py
from easygui import *
def main_menu():
choices = ["Start a New Order", "Exit"]
return choicebox("Welcome to Kahwa Coffee Order System!\nPlease select an option:", "Kahwa Coffee", choices)
def get_customer_details():
delivery_or_pickup = choicebox("Is this order for pickup or delivery?", "Order Type", ["Pickup", "Delivery"])
if delivery_or_pickup == "Delivery":
details = []
details.append(enterbox("Enter customer's name:", "Customer Name"))
details.append(enterbox("Enter customer's address:", "Customer Address"))
details.append(enterbox("Enter customer's phone number:", "Customer Phone Number"))
else:
details = [enterbox("Enter customer's name:", "Customer Name")]
return delivery_or_pickup, details
def main():
while True:
choice = main_menu()
if choice == "Exit":
break
if choice == "Start a New Order":
order_details = get_customer_details()
main()