All pastes #921007 Raw Edit

Unnamed

public text v1 · immutable
#921007 ·published 2008-02-27 19:28 UTC
rendered paste body
public void addProduct(Product item)
  {
    int index = 0;  //LCV
    boolean found = false;
    while(index < stock.size() && !found)
    {
      item = stock.get(index);
      if(stock.contains(item))
      {
         found = false;
         System.out.println("This ID has already been put in");
         System.out.println("Please put in a different ID number");
      }
      else
      {       
        index++; //increment
      }
    }
    stock.add(item);
  }