This code was used to show creating a class with constructor overloading and function overloading (to show encapsulation and polymorphism). The final version shows creating inline functions (including within a composite class), using composition, overloading constructors and functions, and basic usage of a class with OOP concepts (Polymorphism and Encapsulation).
Working on G++ and CLang with C++ 14 or higher. Will generate warning for not used and should be const in certain version (this goes through several iterations so expect these to disappear towards later histories).
- Use
fabsinstead ofabsfor the random number in the constructor