Skip to content

Instantly share code, notes, and snippets.

class Shape {
//Shapes will have a number of sides
var numberOfSides = 0
var name: String
//Constructor
init(name: String){
self.name = name
}
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