Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in Python please Vrite a program that tallies the items one places inside their shopping cart. It should have functions below: a. def main_menu(): This

in Python please image text in transcribed
image text in transcribed
image text in transcribed
Vrite a program that tallies the items one places inside their shopping cart. It should have functions below: a. def main_menu(): This function should display the main menu and return the response selected by the user to the main function. It should contain logic to account for invalid response input. b. def cart_menu(): This function should display the shopping cart items and return the response selected by the user to the main function. It should contain logic to account for invalid response input. c. def main0: This function is responsible for keeping track of the item count and the total cost of all the items added to the cart and displaying the final output. d. You are free to use more functions than those listed. Use the sample output to guide you on the program logic. Please note: - Strip your string input and make sure you are accounting for upper- and lowercase input. - Don't use global variables. - Currency values should be displayed to 2 decimal places. - Your program should ork as shown in the sample output. SAMPLE OUTPUT _.CART MENU ..MAIN MENU- 1: Cookie - $1.50 s: Shop 2: Sandwich - \$4.00 x : Exit 3: Water - $1.00 Option: q Item: 2 Invalid (s/x): s Added sandwich ...CART MENU-.. ..MAIN MENU-... 1. Cookie $1.50 2: Sandwich $4.00 3: Water - $1.00 s: Shop Item: 0 x : Exit Invalid (1-3): 1 Option: S Added cookie - CART MENU -.. - .MAIN MENU-.. 1: Cookie - $1.50 s: Shop 2. Sandwich - $4.00 x : Exit 3: Water $1.00 Option: S Item: 3 \( \begin{array}{ll}\text { 1: CART MENU-_ } & \text { s: Shop } \\ \text { 2: Sandwich - } 54.00 & \text { x: Exit } \\ \text { 3. Warer - S1.00 } & \text { Option: } x\end{array} \) 3: Water - $1.00 Invalid (1-3): 1 1: Cookie - $1.50 Added cookie 2: Sandwich - $4.00 ...MAIN MENU ... 3: Water - $1.00 s: Shop Item: 3 x : Exit Added water Option: S _.MAIN MENU-.. ...CART MENU ... s: Shop 1: Cookie - $1.50 x: Exit 2: Sandwich - $4.00 Option: x 3: Water - $1.00 Item: 1 (2) - Cookie =$3.00 Added cookie (1) Sandwich =$00 -MAIN MENU-.. (1) - Water - $1.00 s: Shop x : Exit GRAND TOTAL =$8.00 Option: s

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_2

Step: 3

blur-text-image_3

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

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions

Question

2. Is this illegal harassment/discrimination?

Answered: 1 week ago

Question

c. How is trust demonstrated?

Answered: 1 week ago

Question

Have issues been prioritized?

Answered: 1 week ago

Question

d. How will lack of trust be handled?

Answered: 1 week ago