Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

..... Design and implement a reusable program that takes any standard Shape and

ID: 3543044 • Letter: #

Question

.....

Design and implement a reusable program that takes any standard Shape and returns a Rectangle that completely incloses the Shape. I expect you to write a class that defines a method to handle a shape. Let's name the class as MyClass and the method as reusable. For simplicity, consider only Rectangle2D. Double and Line2D. Double whenever you need to show specific Shapes in your answer. You don't have to concern about drawing shapes for this question. Your job is to answer the subquestions (a) through (d). API is on the last page. Identify required classe(s) and interface(s) to solve the problem and draw the corresponding class diagram to depict their relationship. Include specific Shapes in your class diagram. Implement the reusable program MyClass. Write a tester that calls the reusable method with two different specific Shape objects. Public class Teacher { public static void main (String [] args) { // your work goes here. Briefly explain how polymorphism is used in the execution of the reusable method.

Explanation / Answer