November 2016
Intermediate to advanced
480 pages
14h 42m
English
Mayors are people too.
An instance of the Mayor type will naturally get nervous whenever its town loses some population due to a Zombie attack.
Create a stored instance property on the Mayor type called anxietyLevel.
It should be of type Int and should start out with a default value of 0.
Increment the anxietyLevel property every time a Mayor instance is notified of a Zombie attack.
Last, as a mayor will not want to outwardly display anxiety, mark this property as private.
Verify that this property is not accessible in main.swift.
Read now
Unlock full access