Define an abstract base class Point that includes protected data members for the (x, y) position of
Fantastic news! We've Found the answer you've been seeking!
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 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.
Related Book For
Understandable Statistics Concepts And Methods
ISBN: 9781337119917
12th Edition
Authors: Charles Henry Brase, Corrinne Pellillo Brase
Posted Date: