The homework 3 of OOP class