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

(Solved) : Complete Code Dijsktra S Algorithm Smaller Priority Higher Public Class Priorityqueue Impl Q33249423 . . . .(Solved) : Complete Code Dijsktra S Algorithm Smaller Priority Higher Public Class Priorityqueue Impl Q33249423 . . . .

<p>Complete code for Dijsktra's Algorithm:</p><p>/*<br/>* The smaller priority, the higher<br/>*/</p><p>//public class PriorityQueue<T> implementsHeapADT<T><br/>public class PriorityQueue<T><br/>{<br/>private NodePriorityQueue<T> root;<br/>int numNodes;</p><p>public PriorityQueue()<br/>{<br/>root = null;<br/>numNodes = 0;<br/>}<br/>  <br/>public void addElement(T element)<br/>{<br/>addElement(0, element);<br/>}<br/>  <br/>public void addElement(double priority,