I think you need to do a bit of homework by yourself too.
You’d need a base class (pendulum) that has methods
singlePendulumManagement() and dublePendulumManagement(). It can be an interface too. Then you’ll extend that base class (or interface) to classes that have different implementations of those functions.
Function call could be like this void pendulumManagement(BaseClass bc, boolean pendul)