Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Write a program that tallies the items one places inside their shopping cart. It should have the functions below: a . def main

1. Write a program that tallies the items one places inside their shopping cart. It should have the 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.
Please note: Use the function name provided. The function should have no parameters and must return a string value.
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.
Please note: Use the function name provided. The function should have no parameters and must return a numeric value.
c. def main(): 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.
Please note: Use the function name provided. The function should have no parameters and must return no value.
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 lower-case input.
Dont use global variables.
Currency values should be displayed to 2 decimal places.
Your program should work as shown in the sample output scenarios below (i.e., dont change the menu items or how the prompts are displayed).

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

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

ISBN: 1844804526, 978-1844804528

More Books

Students also viewed these Databases questions

Question

What is the preferred personality?

Answered: 1 week ago