Skip to content

Latest commit

 

History

History
4 lines (3 loc) · 410 Bytes

File metadata and controls

4 lines (3 loc) · 410 Bytes

Adapter Coding Exercise

You are given a class called Square and a function calculate_area() which calculates the area of a given rectangle.

In order to use Square in calculate_area, instead of augmenting it with width/height members, please implement the SquareToRectangleAdapter class. This adapter takes a square and adapts it in such a way that it can be used as an argument to calculate_area().