Quote:
I cannot find the exact solution. That's why I need a proper solution.
There is no "exact solution" to a generic question like this: it depends on so many different variables. You will have to study pretty much the whole of OOPs design and formulate your own opinion.
If your course notes do not cover it - and they probably do - then start here and read some articles, follow some links, see what you can find out:
Why do we use polymorphism and templates - Google Search[
^]