Answered step by step
Verified Expert Solution
Link Copied!

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 languageimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

3. Is IBMs program really a mentoring program? Why or why not?

Answered: 1 week ago