Question: 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 !!Its Java Programming Language !! Question 2 20 + 20 + 20

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

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!