Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public static ShoppingBag[] packIntoBags(GroceryItem[] goods) {
  2. ShoppingBag newBag = new ShoppingBag();
  3. GroceryItem tmpObject = null;
  4. int index =0;
  5. String bag = "newBag";
  6. String bagNum = bag+index;
  7.  
  8.  
  9.  
  10.  
  11. for (int i=0; i<MAXNBAG;i++)
  12. if (newBag.numItems() < MAX_NUM_ITEMS){
  13.  
  14.  
  15. for (int k=0; i<MAX_NUM_ITEMS; i++) {
  16. tmpObject=goods[i];
  17. newBag.addToBag(tmpObject);
  18. }
  19. }
  20. else {
  21. ShoppingBag newBag1 = new ShoppingBag();
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement