logo

Crowdly

Browser

Add to Chrome

A retail application calculates shipping costs using a ShippingCalculator clas...

✅ 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?

0%
100%
0%
0%
0%
More questions like this

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome