Question: C + + 3 1 . 1 5 LAB * : Program: Online shopping cart ( Part 2 ) LAB ACTIVITY 3 1 . 1

C++
31.15 LAB*: Program: Online shopping cart (Part 2)
LAB
ACTIVITY
31.15.1: LAB*: Program: Online shopping cart (Part 2)?**
031
This program extends the earlier "Online shopping cart (Part 1)" program. (Consider first saving your earlier program).
Step 1: Extend the ItemToPurchase class per the following specifications:
Parameterized constructor to assign item name, item description, item price, and item quantity (default values of 0).(1 pt)
Public member functions
SetDescription () mutator & GetDescription() accessor (2 pts)
PrintItemcost ()- Outputs the item name followed by the quantity, price, and subtotal
PrintItemDescription ()- Outputs the item name and description
Private data members
string itemDescription - Initialized in default constructor to "none"
Ex. of PrintItemCost () output:
Bottled water 10 @ $1=$10
Ex. of printItemDescription() output:
Bottled Water: Deer Park, 12 oz.
Step 2: Build three new files:
Shoppingcart. h- Class declaration
ShoppingCart. cpp-Class definition
main. cpp-main () function (Note: mainO's functionality differs from the previous program.)
Build the ShoppingCart class with the following specifications.
Default constructor
Parameterized constructor which takes the customer name and date as parameters (1 pt)
C + + 3 1 . 1 5 LAB * : Program: Online shopping

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!