Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using java Design a new Parallelogram class that extends the abstract GeometricObject class. The class contains three double data fields B, A, H and its

image text in transcribed

using java

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 values

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

2. What potential barriers would you encourage Samuel to avoid?

Answered: 1 week ago

Question

6. How would you design your ideal position?

Answered: 1 week ago