Continental interview question

OOP questions and a simple program to implement