import sqlite3 conn = sqlite3.connect("bj.db") cursor = conn.cursor() print("Welcome to Ben & Jerry's!") print("What is your favorite flavor of ice cream?") cursor.execute("select name from flavor") baseFlavors = cursor.fetchall() for i, flavor in enumerate(baseFlavors, start=1): print(f" {i}) {flavor[0]}") their_choice = int(input("> ")) fave_flavor = baseFlavors[their_choice-1][0] print(f"Your fave flave is {fave_flavor}!") cursor.execute("select name from recipe where flavorName=?", (fave_flavor,)) recipes = cursor.fetchall() for i, recipe in enumerate(recipes, start=1): print(f" {i}) {recipe[0]}") print("Which recipe looks GOOD? ") their_choice = int(input("> ")) recipe = recipes[their_choice-1][0] num_cartons = int(input(f"How many cartons of {recipe} do you want? ")) cursor.execute("update recipe set cartonsOrdered=cartonsOrdered+? where name=?", (num_cartons, recipe)) conn.commit() cursor.execute("select cartonsOrdered from recipe where name=?", (recipe,)) results = cursor.fetchall() print(f"Great! There are now {results[0][0]} cartons of {recipe} ordered!")