Inheritance enables a class to reuse code
from other classes. In this example we would like the class Square to inherit from Rectangle.
This is specified after the class name with a colon followed by the public keyword and
the name of the class we wish to inherit from. Rectangle now becomes a base class of Square
which in turn becomes a derived class of Rectangle. In addition to its own members Square gains
all accessible members in Rectangle, except for its constructors and destructor. Because Square is now a kind of Rectangle
it can be used anywhere a Rectangle would be expected. For example, we can pass a Square
as an argument to a function that expects a Rectangle since the Square class contains
everything in the Rectangle class. Inside the function the Square is viewed as a Rectangle
so we can here only access the Rectangle members.