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
PayPal Gateway not configured
PayPal Gateway not configured