Design an abstract class GeometricObject with lineColor as data member. GeometricObject must ensure that its children implement calcArea() method. Design Rectangle and Circle classes as children of GeometricObject class with overridden toString() method to return “ Rectangle with ‘w’ width and ‘h’ height is drawn” OR “Circle with ‘r’ radius is drawn”.
- The attribute of Rectangle are length and width
- The attribute of Circle is radius
*Hint:
Area of Circle= πr2
Area of Rectangle=w*l
1
Expert's answer
2020-06-26T05:41:32-0400
Dear arwa, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Comments
Leave a comment