Introduction The Open/Closed Principle states that software entities (such as classes, modules, functions, etc) should be open for extension, but closed for modification. This essentially means that such an entity can allow its behaviour to be extended without modifying its source code. A class is closed, since it may be compiled…