Math, asked by Shubhankar2607, 5 months ago

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 itslovewar
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 bosisiko
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