C++ codes on all the oops concept