Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a script that keeps track of the goods the user placed into their cart and totals it at the end. The three functions should

Create a script that keeps track of the goods the user placed into their cart and totals it at the end. The three functions should be used - def_home(): - the home menu, def_goods(): - displays goods that can be purchased, def_item(): - keeps track of the count and cost of goods to total them and display when the script is ended, and more if needed..

** strip the string input/user input. consider for upper/lower case inputs. no global variables. function must return the option selected.**

EXAMPLE CODE:

Home:

a. Goods

b. Done

Please choose either option a or b: f

Not a valid option, try again: a

Goods:

1. Pizza - $3.00

2. Chips - $1.00

3. Soda - $2.00

Please choose a good: 14

Not a valid option: 2

Chips have been added to the cart.

Home:

a. Goods

b. Done

Please choose either option a or b: a

Goods:

1. Pizza - $3.00

2. Chips - $1.00

3. Soda - $2.00

Please choose a good: 3

Soda has been added to the cart.

Home;

a. Goods

b. Done

Please choose either option a or b: a

Goods:

1. Pizza - $3.00

2. Chips - $1.00

3. Soda - $2.00

Please choose a good: 2

Chips have been added to the cart.

Home:

a. Goods

b.

Done Please choose either option a or b: b

Thank you for shopping with us!

(1) - Pizza - $3.00

(2) - Chips - $2.00

(1) - Soda - $2.00

Your total is $7.00

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

Students also viewed these Databases questions

Question

Create a workflow analysis.

Answered: 1 week ago