Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static ShoppingBag[] packIntoBags(GroceryItem[] goods) {
- ShoppingBag newBag = new ShoppingBag();
- GroceryItem tmpObject = null;
- int index =0;
- String bag = "newBag";
- String bagNum = bag+index;
- for (int i=0; i<MAXNBAG;i++)
- if (newBag.numItems() < MAX_NUM_ITEMS){
- for (int k=0; i<MAX_NUM_ITEMS; i++) {
- tmpObject=goods[i];
- newBag.addToBag(tmpObject);
- }
- }
- else {
- ShoppingBag newBag1 = new ShoppingBag();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement