Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

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