/* CookieBroker - example solution to exercise "Cookies" * @author Kees Huizing * @version 1.1 2009-10-21 */ import java.util.Scanner; class CookieBroker { final int NUMDAYS = 6; // number of delivery days Scanner scanner; int[] orders; // for each day the number of cookies String supplier; // supplier code double coffeePrice; // world market coffee price // calculate price of CookieMonster double priceCM(int n) { return 10+5.5*n; } // calculate price of Verkade double priceV(int n) { double price; if (n<10) { price = 6*n; } else if (n<25) { price = 5*n; } else { price = 4*n; } return price; } // calculate price of WaffleBaffle double priceWB(int n, double w) { return 20 + 4 * n + (w-3)*0.10 * n; } // calculate week cost of supplier sup given coffeePrice w double calcCost(String sup, double w) { double cost = 0; for (int i=0; i