Question: Create an Inheritance lab where you implement 8 numbers (x1, y1, x2, y2..... Until you get to x4, y4) in the main class. Then create
Files 1 Main.java Parallelogram.java 4 Quadrilateral.java 9 Quadrilateral.ava public class Quadrilateral 2 protected int 91,92,93,94,1,2,3.; 3 protected double siden, side2, side, side4, d1,d2; protected double slopei, slope2, slope, sloped, dslope1, dslope2; 5 public Quadrilateral (int a, int b, Inte, int d, int e, int f. inte. Int h) 6 41-a: 7 92-b; 93-c; 44.d; 10 wl-es 11 W2-1; 12 W3-8 13 nh; 14 sidel-getlength(91,w1.42.2); 15 side2-get Length(92,W2,93,wa); 16 side-getLength(3,3,4, ); 17 di-getLength(91,w1,43,3); 18 d2-getLength(92,2,44,4): 19 slopei-getslope(at, w1,42.12): 2e 21 2 public double gettength(int a, int b, Int , int d) 23 return Math.sqrt(Math.powe(ca. 2) Math pow(d.b, 2)): 25 26 27 28 29 38 public double getslope(inta, int b, intint d){ If (Ca) return -999; return double (d-b>/(-a): 1 Files 1 Main.java Parallelogram.java 4 Quadrilateral.java 9 Quadrilateral.ava public class Quadrilateral 2 protected int 91,92,93,94,1,2,3.; 3 protected double siden, side2, side, side4, d1,d2; protected double slopei, slope2, slope, sloped, dslope1, dslope2; 5 public Quadrilateral (int a, int b, Inte, int d, int e, int f. inte. Int h) 6 41-a: 7 92-b; 93-c; 44.d; 10 wl-es 11 W2-1; 12 W3-8 13 nh; 14 sidel-getlength(91,w1.42.2); 15 side2-get Length(92,W2,93,wa); 16 side-getLength(3,3,4, ); 17 di-getLength(91,w1,43,3); 18 d2-getLength(92,2,44,4): 19 slopei-getslope(at, w1,42.12): 2e 21 2 public double gettength(int a, int b, Int , int d) 23 return Math.sqrt(Math.powe(ca. 2) Math pow(d.b, 2)): 25 26 27 28 29 38 public double getslope(inta, int b, intint d){ If (Ca) return -999; return double (d-b>/(-a): 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
