Exercise 3: is_a and has_a

Summary

Implement an IsA function for the Entity class which will perform a depth-first search on is_a relationships to determine whether an entity has a direct or indirect is_a relationship with another entity.
Implement a HasA function for the Entity class which will perform a depth-first search on the is_a relationship followed by a depth of one search of has_a.
Throw an exception from Entity.Get as well as Entity.Set if the requested property does not exist.

Test case:

Click here

Solution

Click here