✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
A retail application calculates shipping costs using a ShippingCalculator class. Inside this class, the developer uses a massive series of if-else statements checking if (package instanceof StandardBox) else if (package instanceof FragileCrate) to apply different mathematical formulas. Next month, the company plans to introduce a new RefrigeratedContainer package type. How should the developer refactor this code to satisfy the Open/Closed Principle?