Question: Define an abstract base class Point that includes protected data members for the (x, y) position of a shape, a public method to move a
Define an abstract base class Point that includes protected data members for the (x, y) position of a shape, a public method to move a shape, and a public abstract method show() to output a shape. Derive subclasses- line, circle, and rectangle. You can represent a line as two points, a circle as a center and a radius, and a rectangle as two points on diagonally opposite corners. Test the classes by selecting ten random objects of the derived classes, and then invoking the show() method for each.
Step by Step Solution
There are 3 Steps involved in it
Heres a Python implementation of the request python import random class Point def initself x y selfx ... View full answer
Get step-by-step solutions from verified subject matter experts
