Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Its Java Programming Language !! Question 2 20 + 20 + 20 = 60 points a. Write a class named Rhombus that extends abstract GeometricObject

Its Java Programming Language !!image text in transcribed

Question 2 20 + 20 + 20 = 60 points a. Write a class named Rhombus that extends abstract GeometricObject class and implements the Cloneable interface. The Rhombus class throws IllegalArgumentException when side is negative. Assume you are given the length of one side (s) and the perpendicular height (h) from one side to the vertex. The area can be computed using the following formula: an area = s*h an b. Write another class named Trapezoid that extends abstract GeometricObject class and implements the Cloneable interface. The Trapezoid class throws IllegalArgumentException when side is negative. Assume you are given the length of parallel sides (a and b) and the perpendicular height (h) to the parallel sides. The area can be computed using the following formula: area = = *(a+b) * h c. Draw the detailed UML diagram that involves Trapezoid, Rhombus, GeometricObject and Cloneable showing all the class relationships, attributes and behaviors with appropriate modifiers. d. Write a program that will build an array of GeometricObject of length length x = the 5th digit of your NSU ID. For example, if your ID is 1238765999, then x = 7. First take input from user to determine what type of GeometricObject to create and calculate the area, according to the following options: If the input is 1: Create a Rhombus If the input is 2: Create a Trapezoid When you are done making the array, print the array contents to a file

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_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

What will you do or say to Anthony about this issue?

Answered: 1 week ago