Capgemini interview question

the coding question to implement inheritance and polymorphism