Project 6
Starter Code
import sqlite3
from datetime import datetime
def main():
print("Project 6")
print("Name: ")
db = 'project6.db'
conn = sqlite3.connect(db)
done = False
while not done:
print("Main Menu")
print("A - Admin Menu")
print("S - Start New Order")
print("Q - Quit")
choice = input("Choice: ").upper()
if choice == "A":
admin(conn)
elif choice == "S":
restaurant(conn)
elif choice == "P":
past_orders(conn)
elif choice == "C":
view_customers(conn)
elif choice == "Q":
print("Quitting!")
done = True
else:
print("Invalid, try again!")
#close the connection
conn.close()
# admin function
def admin(conn):
print("Admin Menu")
done = False
while not done:
print("CREATE1 - Create menu table")
print("CREATE2 - Create customers table")
print("CREATE3 - Create orders table")
print("CREATE4 - Create order_items table")
print("INSERT1 - Insert menu items")
print("S - View All Menu Items")
print("P - Past Orders")
print("C - View All Customers")
print("Q - Quit")
choice = input("Choice: ").upper()
if choice == "Q":
print("Quitting!")
done = True
else:
print("Invalid, try again!")
# start new order function
def restaurant(conn):
print("Restaurant Menu")
# past orders function
def past_orders(conn):
print("Past Orders")
# view customers function
def view_customers(conn):
print("View Customers")
main()
Last updated