One question per stackoverflow.com question, please. As far as whether a particular program "is correct or not", that would be a question for
codereview.stackexchange.com. As far as to what various subclasses should return for a particular method, this is a question that only you can answer yourself, since only you know what your program should do in this case. If a method is declared as returning a reference to an
int
, then this is what it should return. Whether the method is virtual, or not, is irrelevant. C++ requires all methods and function to return values of matching type. —
Sam Varshavchik 35 secs ago