Polygons, Quadrangles and Squares

The purpose of this exercise is to get some experience with programming of classes in a pure specialization hierarchy. I have programmed the class Polygon.
The well-known class The class - A constructor.
`Rank`: The number of edges of the polygon`Circumference`: The sum of the edge lengths.
Now program the following specializations of `Quadrangle``Square`
For the sake of simplicity you are allowed (but not forced) to assume that the edges of the square are parallel with the x-axis and the y-axis. Please refer to the
It is not necessary to use four points for representation of a square. Discuss this problem and try to find a solution. |