while(temp != NULL)
{
if(temp->info.Name == cName)
{
temp->info.DiscountNumber = temp->info.DiscountNumber + 5;
flag = true;
}
if(temp ->info.DiscountNumber > 25)
{
temp->info.DiscountNumber = 25;
// prev->link = temp->link;
// delete temp;
//temp->link = first;
// first = temp;
}
//cout<<"Discount is :"
//<<temp->info.DiscountNumber
//<<endl;
prev = temp;
temp = temp->link;
}
I am writing a program that will read data on customers from a file and grab names from a second file and add a 5% increase on the customer if their name is in the 2nd file. The current problem I am having is that I am trying to take the customers who have a 25% discount and move them all to the front of the list,any help or suggestions would be greatly appreciated