import java.util.*; // for the ArrayList public class MasterOrder { // Draw a picture of this!!!!!!!! private List orders; // given constructor public MasterOrder() { orders = new ArrayList(); } // given addOrder method public void addOrder(CookieOrder theOrder) { orders.add(theOrder); } // ****** to be written for part a // get the total number of boxes ordered public int getTotalBoxes() { return 0; } // ****** to be written for part b // return the number of boxes removed public int removeVariety(String cookieVar) { return 0; } public String toString() { return orders.toString(); } // given // a main method to get started public static void main(String[] args) { MasterOrder theOrders = new MasterOrder(); theOrders.addOrder(new CookieOrder("Chocolate Chip",1)); theOrders.addOrder(new CookieOrder("Shortbread",5)); theOrders.addOrder(new CookieOrder("Macaroon",2)); theOrders.addOrder(new CookieOrder("Chocolate Chip",3)); // The rest is not shown } // end of main } // this class is given // notice it is immutable class CookieOrder { // code not shown String variety; int numBoxes; // constructor public CookieOrder(String variety, int numBoxes) { // implementation not shown this.variety = variety; this.numBoxes = numBoxes; } public String getVariety() { // implementation not shown return variety; } public int getNumBoxes() { // implementation not shown return numBoxes; } // for testing results public String toString() { return variety + " " + numBoxes; } }