Encapsulation and polymorphism homework