Exercise: Transforming Shape Area Calculation
Practice how to refactor code by calculating the area of rectangles while adhering to SOLID principles and good OOD.
Task and requirements
The provided code calculates the total area of rectangles but does not adhere to SOLID principles. Your task is to refactor the code to make it conform to the SOLID principles, especially the Single Responsibility Principle (SRP) and the Open/Closed Principle (OCP). ...
Get hands-on with 1400+ tech skills courses.