Yes, you can do that.
In the base class, you'll want to have two groups of functions:
- Public, non-virtual functions that users of the class will call.
- Protected, pure-virtual functions that will be implemented by the derived classes.
In the base class's public non-virtual functions, you can do any necessary argument checking, e.g. making sure that the argument isn't negative. Throw exceptions as necessary. Then, if the argument checks pass, call the corresponding virtual function to let the derived class do the rest.
Also, note that if negative numbers don't make sense for your function's arguments, it may be simper to just use unsigned types for those arguments.