Exercise 1: A LoyaltyDiscount, Standard-Shipping Order — Possible Solution ==================================================================== BUILDING THE ORDER, USING ONLY EXISTING CLASSES ------------------------------ order = (OrderBuilder() .items_total(150) .weight(8) .discount_strategy(LoyaltyDiscount()) .build()) No new classes were needed - LoyaltyDiscount already exists from this chapter's own capstone code, and shipping_strategy() is deliberately left uncalled, so OrderBuilder's own default (StandardShippingStrategy) applies automatically. HAND CALCULATION ------------------------------ discount = 150 * 0.10 = 15 final = 150 - 15 = 135 shipping = 8 * 0.5 = 4 total = 135 + 4 = 139 VERIFYING AGAINST THE ACTUAL CODE ------------------------------ Exercise 1 total: 139.0 manual: 150 - 150*0.10 + 8*0.5 = 139.0 Both match exactly. WHY NO SHIPPING STRATEGY CALL WAS NEEDED ------------------------------ This chapter's own OrderBuilder.__init__() sets self._shipping_strategy = StandardShippingStrategy() as its default before any builder method is even called - so an order that never needs priority shipping doesn't have to mention shipping at all, and still gets the correct standard-rate calculation. WHY THIS WORKS AS AN ANSWER ------------------------------ The order is built entirely from this chapter's own existing classes, using the builder's own default for the strategy that wasn't explicitly set, and the result is verified against a step-by-step hand calculation rather than only the final total.