Exercise 3: A Second New Shipping Type — Possible Solution ==================================================================== THE NEW CLASS ------------------------------ class EconomyShipping(ShippingStrategy): def calculate(self, weight): return weight * 0.3 + 2 Added alongside this chapter's own InternationalShipping, bringing the hierarchy to five classes total: StandardShipping, ExpressShipping, OvernightShipping, InternationalShipping, and now EconomyShipping. RESULTS ------------------------------ All 4 pre-existing classes verified byte-identical after adding EconomyShipping: StandardShipping unchanged: True ExpressShipping unchanged: True OvernightShipping unchanged: True InternationalShipping unchanged: True EconomyShipping.calculate(10) = 5.0, hand calculation = 5.0, match = True Every class that existed before this exercise - including InternationalShipping, itself only added in this chapter's own main text - stays byte-identical after EconomyShipping is added. The new class's own cost calculation matches a hand-computed check exactly. WHY THIS WORKS AS AN ANSWER ------------------------------ This confirms the chapter's own central claim doesn't only hold for the first extension beyond the original three classes - it holds for every extension after that, indefinitely. InternationalShipping was itself proof that adding a new type doesn't disturb the three original classes; this exercise proves that InternationalShipping, once added, becomes just as stable as the three it joined. Each new shipping type added this way permanently strengthens the guarantee rather than being a one-time result that might not generalize further.