This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Shape { | |
//Shapes will have a number of sides | |
var numberOfSides = 0 | |
var name: String | |
//Constructor | |
init(name: String){ | |
self.name = name | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Circle { | |
var radius : Double | |
init(theradius: Double) { | |
//Update classes radius value with the one provided | |
radius = theradius | |
} | |
func getArea() -> Double { | |
//Calculate the area of the circle |