hw5 inheritance with one child