Question: C + + , Welcome to my Online Shopping Program! 1 . Add item 2 . Remove item 3 . Modify item 4 . Print

C++,
Welcome to my Online Shopping Program!
1. Add item
2. Remove item
3. Modify item
4. Print cart
5. Checkout
What would you like to do?1
Name: toothbrush
Cost: $ 4.53
Quantity: 2
1. Add item
2. Remove item
3. Modify item
4. Print cart
5. Checkout
What would you like to do?3
# Item Price Qty Total Cost
-----------------------------------------
1. toothbrush $4.532 $9.06
Enter item to modify: 2
Error. Enter valid item number: c
Error. Enter valid item number: 1
Name: toothbrush
Cost: $ 4.53
Quantity: 1
1. Add item
2. Remove item
3. Modify item
4. Print cart
5. Checkout
What would you like to do?1
Name: soap
Cost: $ c
Invalid cost. Enter cost: $ cat
Invalid cost. Enter cost: $ -3.45
Invalid cost. Enter cost: $ 0
Quantity: c
Invalid quantity. Enter quantity: 0
Invalid quantity. Enter quantity: 3.45
Invalid quantity. Enter quantity: 3
1. Add item
2. Remove item
3. Modify item
4. Print cart
5. Checkout
What would you like to do?1
Name: floss
Cost: $ 3.00
Quantity: 4
1. Add item
2. Remove item
3. Modify item
4. Print cart
5. Checkout
What would you like to do?4
# Item Price Qty Total Cost
-----------------------------------------
1. toothbrush $4.531 $4.53
2. soap $03 $0.00
3. floss $3.004 $12.00
1. Add item
2. Remove item
3. Modify item
4. Print cart
5. Checkout
What would you like to do?2
# Item Price Qty Total Cost
-----------------------------------------
1. toothbrush $4.531 $4.53
2. soap $03 $0.00
3. floss $3.004 $12.00
Which item would you like to remove? 2
1. Add item
2. Remove item
3. Modify item
4. Print cart
5. Checkout
What would you like to do?5
Cart contents:
# Item Price Qty Total Cost
-----------------------------------------
1. toothbrush $4.531 $4.53
2. floss $3.004 $12.00
Please pay: $16.53
Thank you for shopping with us!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!