9. write an inheritance hierarchy for classes quadrilateral, trapezoid, parallelogram, rectangle and square. use quadrilateral as the superclass of the hierarchy. create and use a point class to represent the points in each shape. make the hierarchy as deep (i.e., as many levels) as possible. specify the instance variables and methods for each class. the private instance variables of quadrilateral should be the x-y coordinate pairs for the four endpoints of the quadrilateral. write a program that instantiates objects of your classes and outputs each object’s area (except quadrilateral)
Answers
Answered by
3
Answer:
9. write an inheritance hierarchy for classes quadrilateral, trapezoid, parallelogram, rectangle and square. use quadrilateral as the superclass of the hierarchy. create and use a point class to represent the points in each shape. make the hierarchy as deep (i.e., as many levels) as possible. specify the instance variables and methods for each class. the private instance variables of quadrilateral should be the x-y coordinate pairs for the four endpoints of the quadrilateral. write a program that instantiates objects of your classes and outputs each object’s area (except quadrilateral)
Answered by
0
Answer:
public class Quadrilateral {
private int x;
private int y;
public Quadrilateral (int x, int x){
this. x=x;
this.y=y;
}
}
Similar questions
World Languages,
2 months ago
Social Sciences,
2 months ago
Math,
2 months ago
Chemistry,
5 months ago
Environmental Sciences,
5 months ago
Math,
11 months ago
Hindi,
11 months ago