Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java code A UML class diagram of the abstract class GeometricObject is given below. Design a new Parallelogram class that extends the abstract GeometricObject class.
Java code
A UML class diagram of the abstract class GeometricObject is given below. Design a new Parallelogram class that extends the abstract GeometricObject class. The class contains three double data fields B, A, H and its angle with default values 3.0,1.0,1.732, and 30 . The following diagram shows the parameters related with a parallelogram. Write a test program that prompts the user to enter B,A,H and its angle , a color, and a Boolean value to indicate whether the parallelogram is filled. The program should create a Triangle object with these values and set the color and filled properties using the input. The program should display the area of parallelogram, B, A, H and its angle , color, and true or false to indicate whether it is filled or not. The formula for computing the area of a parallelogram is area =BH Your class should also include equals and compareTo methods. The compareTo method compares two parallelograms based on the parallelogram's area values. The equals method compares two parallelograms based on their B,A and H valuesStep 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