/*
Your challenge is this: make a class hierarchy
for animals, starting with Animal at the top,
then Dog and Cat as subclasses, then Corgi and
Poodle as subclasses of Dog, and Persian and Lion
as subclasses of Cat.
But there’s more:
The Animal class should have a legs integer
property that tracks how many legs the animal has.
The Dog class should have a speak() method that
prints a generic dog barking string, but each of
the subclasses should print something slightly
different.
The Cat class should have a matching speak() method,
again with each subclass printing something
different.
The Cat class should have an isTame Boolean property,
provided using an initializer.
https://www.hackingwithswift.com/quick-start/beginners/checkpoint-7
*/classAnimal{var legs =4init(legs:Int){self.legs = legs
}}classDog: Animal {funcspeak(){print("woof")}}classCorgi: Dog {overridefuncspeak(){print("Your Majesty?")}}classPoodle: Dog {overridefuncspeak(){print("yip")}}classCat: Animal {var isTame:Boolinit(isTame:Bool, legs:Int){self.isTame = isTame
super.init(legs: legs)}funcspeak(){print("meow")}}classPersian: Cat {overridefuncspeak(){print("hiss")}init(){super.init(isTame:true, legs:4)}}classLion: Cat {overridefuncspeak(){print("rawr")}init(){super.init(isTame:false, legs:4)}}let lion = Lion()print(lion.legs)