Skip to content

Files

Latest commit

4b42b88 · Jul 22, 2020

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 22, 2020
Jul 22, 2020

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().