note c i need code that exactle follow all instructions i have done 4 files and need 5152902

Note: C++

I need code that exactle follow all instructions.

I have done 4 files, and need to do main.cpp and check that everything works correct.

cartItems + ShoppingCart () + shoppingcart (string name) + string getcustomerName O const +void addItem (ItemToPurchase) +void removeItem (string) + void changeQuantity (string, int) + double getTotalCost (O + void printcarto addltem o use push_back to add the given Item ToPurchase argument to the end of cartltems” src=”https://files.transtutors.com/cdn/qimg/2a16f940181b47b9ad432e98a97e3789.jpg” aria-describedby=”apm”>

Here is the code:

********************************************************************************************

///main.cpp

*

*

*

*

*

**********************************************************************************************

///ItemToPurchase.cpp

#include
#include “ItemToPurchase.h”

using namespace std;

ItemToPurchase::ItemToPurchase() {
itemName = “none”;
itemPrice = 0;
itemQuantity = 0;
}
ItemToPurchase::ItemToPurchase(string n, double p, int q) {
itemName = n;
itemPrice = p;
itemQuantity = q;
}
void ItemToPurchase::setName(string s){
itemName = s;
}
void ItemToPurchase::setPrice(double p){
itemPrice = p;
}
void ItemToPurchase::setQuantity(int q){
itemQuantity = q;
}
string ItemToPurchase::getName() const{
return itemName;
}
double ItemToPurchase::getPrice() const{
return itemPrice;
}
int ItemToPurchase::getQuantity() const{
return itemQuantity;
}
void ItemToPurchase::printItemCost(){
cout
}

**************************************************************************************************************

///ItemToPurchase.h

#include

using namespace std;

class ItemToPurchase {
private:
string itemName;
double itemPrice;
int itemQuantity;

public:
ItemToPurchase();
ItemToPurchase(string name, double price, int quantity);
void setName(string);
void setPrice(double);
void setQuantity(int);
string getName() const;
double getPrice() const;
int getQuantity() const;
void printItemCost();
};

*********************************************************************************************************

///ShoppingCart.cpp

#include “ShoppingCart.h”

#include
#include
using namespace std;

ShoppingCart::ShoppingCart()
{
customerName = “None”;
}

ShoppingCart::ShoppingCart(string name)
{
customerName = name;
}

string ShoppingCart::getCustomerName() const
{
return customerName;
}

void ShoppingCart::addItem(ItemToPurchase item)
{
cartItems.push_back(item);
}

void ShoppingCart::removeItem(string name)
{
for (int i = 0; i
{
if (cartItems.at(i).getName() == name)
{
cartItems.erase(cartItems.begin() + i);
}
else
{
cout
}
}

}

void ShoppingCart::changeQuantity(string name, int quantity)
{
for (int i = 0; i
{
if (cartItems.at(i).getName() == name)
{
cartItems[i].setQuantity(quantity);
}
else
{
cout
}
}
}

double ShoppingCart::getTotalCost()
{
double sum = 0.0;
for (int i = 0; i
{
sum += cartItems[i].getQuantity() * cartItems[i].getPrice();
}
return sum;
}

void ShoppingCart::printCart()
{
cout
for (int i = 0; i
{
cartItems.at(i).printItemCost();
}
cout
cout
}

******************************************************************************************************************

///ShoppingCart.h

#ifndef ShoppingCart_hpp
#define ShoppingCart_hpp

#include
#include
#include “ItemToPurchase.h”
using namespace std;

class ShoppingCart
{
private:
string customerName;
vector cartItems;

public:
ShoppingCart();
ShoppingCart(string name);
string getCustomerName() const;
void addItem(ItemToPurchase);
void removeItem(string);
void changeQuantity(string, int);
double getTotalCost();
void printCart();
};
#endif

********************************************************************************************************************************************

11.19 Assignment Part 2: Online shopping cart (continued) This program extends the earlier Online shopping cart' program. (Consider first backing up your earlier progra) Create three new files o ShoppingCart.h-Class declaration o ShoppingCart.cpp – Class definition main.cpp – Note: main's functionality differs from the previous exercise Build the ShoppingCart class with the following specifications ShoppingCart – string customerName vector cartItems + ShoppingCart () + shoppingcart (string name) + string getcustomerName O const +void addItem (ItemToPurchase) +void removeItem (string) + void changeQuantity (string, int) + double getTotalCost (O + void printcarto addltem o use push_back to add the given Item ToPurchase argument to the end of cartltems

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now