Petshop - training repository
There is solved an easy task. Text of the task:
- Create classes:
Cat
,Dog
andPetshop
. - Types
Cat
andDog
have fieldsName
andBreed
and methodIntroduce()
which prints text"I'm (Name) of (Breed). I'm a cat (or dog)".
- The class
Petshop
collects in its container different pets. We may add new pet to container by methodAddPet()
and we may display information about all pets by methodIntroduceAll()
. - Which hierarchy of classes is the best solution of this problem?
- Write short code to demonstrate your solution.
- Your code should include class (interface) aggregation, inheritance, should use .NET BCL collections or generics, should implement exception handling.