assign6_s_f88/ProductInventory.cpp
/*****************************************************************************
 removeProduct: removes desired product
 string testName, passes name for desired remove product
 string testLoc, passes location for desired remove product
 returns: bool, if found returns true, else false
 ****************************************************************************/
removes desired product
string testName, passes name for desired remove product
string testLoc, passes location for desired remove product
returns: bool, if found returns true, else false
removes desired product string testName passes name for desired remove product string testLoc passes location for desired remove product returns : bool if found returns true else false
bool ProductInventory::removeProduct(string testName, string testLoc)
{
    ProductNode* iter = productList;  
    ProductNode* prev;                
    while(iter != NULL && (iter->data.getProductName() != testName ||
                           iter->data.getLocator() != testLoc))
    {
        prev = iter;
        iter = iter->next;
    }
    if(iter == NULL)
    {
        return false;
    }
    if(iter == productList)
    {
        productList = iter->next;
    }
    else
    {
        prev->next = iter->next;
    }
    delete iter;
    return true;
}
bool ProductInventory :: removeProduct ( string testName , string testLoc ) { ProductNode * iter = productList ; ProductNode * prev ; while ( iter != NULL && ( iter -> data . getProductName ( ) != testName || iter -> data . getLocator ( ) != testLoc ) ) { prev = iter ; iter = iter -> next ; } if ( iter == NULL ) { return false ; } if ( iter == productList ) { productList = iter -> next ; } else { prev -> next = iter -> next ; } delete iter ; return true ; }
removeProduct: removes desired product
string testName, passes name for desired remove product
string testLoc, passes location for desired remove product
returns: bool, if found returns true, else false
removeProduct : removes desired product string testName passes name for desired remove product string testLoc passes location for desired remove product returns : bool if found returns true else false
//pointer to head
 //pointer to previous node
