I need help with a RetailStore class. The class is supposed to do this

Design and implement a class named RetailStore that holds data about an item in a retail store. The class should have the following private data members:
1. name - a string that holds the name of the store
2. numItems - an unsigned that holds the current number of unique items sold in the store
3. item - an array (with 500 slots) of RetailItem objects

I need help with the definition of the class

RetailStore::RetailStore()
{
    storeName = name;
    itemCount = 0;
    
    for (int i=0; i<500; i++)
    {
        item[i] = NULL;
    }
}

string RetailStore::getSearch();
{
    if(int i=0; i<500; i++)
      return i;      
}

string RetailStore::getOrderItems();
{
       // i need help filling out this
}

bool RetailStore::DeleteItem(string name);
{
     if(int i=0; i<500; i++)
       return true;

      else
      return false;
}
bool RetailStore::SubstractUnits(int units);
{
       // i need help filling out this
}

bool RetailStore::AddUnit(int units);
{
       // i need help filling out this
}

bool RetailStore::ChangeDescription(string name);
{
       // i need help filling out this
}

bool RetailStore::ChangePrice(double cost);
{
       // i need help filling out this
}

bool RetailStore::AddItem (string name, int count, double price);
{
       // i need help filling out this
}

void RetailStore::printInventory();
{
     for (int i=0; i<500; i++)
         cout<<
}

bool RetailStore::ChangeDescription(string name)
{
     jacket = new RetailItem1();
     jeans =  new RetailItem2();
     shirt =  new RetailItem3();

}

So you need help with all of the hard parts? ;) It'll be easier to help you if you ask something more specific, like if you try to do some of the code but have an error.

line 27: That whole function is screwy. When line 27 is executed it will stop that loop because the function will end. The code you put there is not what that function should be doing at all. It's supposed to search though the array and erase the item that contains the same name as the function's parameter. You have to use a loop (like you have already written) and inside that loop compare the array with name

// this may not be exactly right because I don't know the class structure
if( array[i] == name)
{
    // found it, so now add code here
     // to remove name from the array
}

Most (if not all) the other methods where you did NOT say you need help are also incorrect.


You didn't post the header file that contains the class declaration, so can't really help much.

I cant post everything in here cause is a project thanks anyways

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.