Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 language
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started