Course Solutions Uncategorized (Solved) : Assignment Part 2 Online Shopping Cart Continued Program Extends Earlier Online Shopping C Q33025225 . . . .

(Solved) : Assignment Part 2 Online Shopping Cart Continued Program Extends Earlier Online Shopping C Q33025225 . . . .

 

Assignment Part 2:

Online shopping cart (continued)

This program extends the earlier “Online shopping cart” program.(Consider first backing up your earlier program).

Create three new files:

ShoppingCart.h – Class declaration

ShoppingCart.cpp – Class definition

main.cpp – Note: main’s functionality differs from the previousexercise

Build the ShoppingCart class with the followingspecifications:

ShoppingCart

– string customerName

– vector cartItems + ShoppingCart()

+ ShoppingCart(string name)

+ string getCustomerName() const

+ void addItem(ItemToPurchase)

+ void removeItem(string)

+ void changeQuantity(string, int)

+ double getTotalCost()

+ void printCart()

addItem

use push_back to add the given ItemToPurchase argument to theend of cartItems

removeItem

loop through the cartItems vector and look forcartItems[i].getName() to match the given string argument

once found, call cartItems.erase(cartItems.begin() + i)

If the item is not found, output

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post