ex 1.2.11 - date class with validation