Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language: Python Program required: Processing 3.0 This is what I have started so far: This is the entire question/assignment. Other than lecture notes from the

Language: Python

Program required: Processing 3.0

image text in transcribed

This is what I have started so far:

image text in transcribed

This is the entire question/assignment. Other than lecture notes from the professor, no other resources are available. Processing 3.0 is used, with the Python library/plugin. No "imports" are required. This is a beginner Python programming course; no need to over-complicate the code.

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 (S1) 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 500x500 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. Menu Bread: $5 Muffin: $3 Your order Bread COOKIE: $1 COOKIE COOKIE COOKIE Cost: $16 Figure 2: A sample order 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, ie, 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

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago

Question

why do consumers often fail to seek out higher yields on deposits ?

Answered: 1 week ago