Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Specify the instance variables and
Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Specify the instance variables and methods for each class. The private instance variables of Quadrilateral should be the xy coordinate pairs for the four endpoints of the Quadrilateral. Write a program that instantiates objects of your classes and outputs each objects area except Quadrilateral Hint: Create and use a Point class to represent the corners of the shapes.use java and please it's not allowed to se any math.abs math.max etc
Sample output:
Coordinates of Quadrilateral are:
Coordinates of Trapezoid are:
Height is :
Area is :
Coordinates of Parallelogram are:
Width is :
Height is :
Area is :
Coordinates of Rectangle are:
Width is :
Height is :
Area is
Coordinates of Square are:
Side is :
Area is :
Step 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