Question: it is an java programming language of Task Open with 20 + 10 + 10 = 50 points An abstract class named GeometricObject is given

it is an java programming languageit is an java programming language of Task Open with 20 +

of Task Open with 20 + 10 + 10 = 50 points An abstract class named GeometricObject is given the following UML diagram. GeometricObject -color: String -filled: boolean #GeometricObject() #GeometricObject(color: String, filled: boolean) +getColor():String +setColor(color: String): void +isFilled(): boolean +setFilled(filled: boolean): void +toString(): String +getArea(): double +getPerimeter(): double a. Design an interface named Drawable with a void method named howToDraw(). Every class of a draw able object must implement the Drawable interface. b. Design two classes named Triangle and Hexagon that extend GeometricObject and implements Drawable. Implement howToDraw to display the message Draw all the sides. c. Draw the detailed UML diagram that involves Triangle, Hexagon, GeometricObject and Drawable showing all the class relationships, attributes and behaviors with appropriate modifiers. d. Write a Test class with the main() method that will build an array of length x that can store both Triangle and Hexagon objects where, x = the 7th digit of your NSU ID. For example, if your ID is 1238765999, then x = 5. When you are done making the array, print the area of the maximum-area object and invoke its howToDraw method if it is draw able. The formula to compute the area of a triangle: s=(sidel + side2 + side3)/2; area = s(s - side 1)(s - side2)(s - side3) The formula to computer the area of a Hexagon: area = side* side Page 1 / 1 +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!