Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language: Python Program required: Processing 3.0 Purpose: To practice list operations such as adding, removing and finding indices Degree of Difficulty: Moderate The Sesame Street

Language: Python

Program required: Processing 3.0

image text in transcribed

Purpose: To practice list operations such as adding, removing and finding indices Degree of Difficulty: Moderate The Sesame Street Bakery sells four items at the following prices. Bread ($5) Doughnut ($2) Muffin ($3) Cookie ($1) For this question, you will write a program that allows the user to place an order at the bakery. Here is how your program should behave. Use a 500 times 500 white canvas as your background On the left side of the canvas. display the bakery's menu, which consists of the name and price of each item. On the right side of the canvas, display all of the items in the user's order so far. Initially, the order will be empty. It is okay if the order gets too big for the screen: you don't need to handle this case. Below the user's order, display the total cost of the entire order. Initially the cost is O. When the user presses the 'b', 'd', 'm' or 'c' keys: Add the appropriate item to the order ('b' for Bread, 'c' for Cookie, etc...) When the user presses the 'u' (for "undo") key: Remove the most recently-added item from the order and adjust the total cost accordingly. It is not possible to solve this question without making at least some use of lists (in particular, you will need a list to store the order). However, to get full marks for this question, you must make effective use of lists beyond the bare minimum in the following ways: Store the items in the bakery's menu in a list, i.e. at the top of your program you will have a statement like menu = ["Bread", "Doughnut", "Muffin". "COOKIE"]. Your program should be designed such that if the bakery were to add another item to its menu, your draw) function would not need to change at all!! Store the prices for each menu item in a list as well, i.e., prices = [5, 2, 3, 1]. Your program should be designed such that if the bakery were to change the price of an item, changing this list of prices is the ONLY thing you would need to do for your program!! Finally designing a graphical picture/logo for the bakery involving gratuitous use of cookies and/or furry blue monsters with googly eyes is not required, but cannot possibly hurt you

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions