Skip to content

Instantly share code, notes, and snippets.

@matiasdim
Created December 4, 2020 14:50
Show Gist options
  • Save matiasdim/6e3ee8086b1103dde64c8ed1671d1490 to your computer and use it in GitHub Desktop.
Save matiasdim/6e3ee8086b1103dde64c8ed1671d1490 to your computer and use it in GitHub Desktop.
class Rectangle {
var width: Int
var height: Int
init(width: Int, height: Int) {
self.width = width
self.height = height
}
}
class AreaCalculator {
func area(rectangle: Rectangle) -> Int {
return rectangle.height * rectangle.width
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment