//This program writes out three classes, triangle,lader,circle, where the triangle class has a,b,c edges with type double and perimeter, area properties,
With perimeter, area, and modification of the three-side function, there is a Boolean class that determines whether a triangle can be formed.
The Lader class has the upper bottom and high, area properties of type Double, with the ability to return an area
The Circlle class has a radius, perimeter, and area of type Double. Has the ability to return the perimeter area.
//Triangle Classclasstriangle{ Public DoubleA; Public Doubleb; Public DoubleC; Publictriangle () {a=0.0; b=0.0; C=0.0; }//The following is the value of the Reference object PublicTriangleDoubleADoubleBDoublec) { This. a=A; This. b=b; This. c=C;} Private BooleanisTrue () {if(A+b>c&&a+c>b&&b+c>a)return true; Else return false; } Public DoubleGetperimeter () {if( This. IsTrue ())returna+b+C; Else return-1; } Public DoubleGetarea () {Doubles= (A+B+C)/2; if( This. IsTrue ())returnMath.sqrt (s* (s-a) * (s-b) * (S-c)); Else return-1; } Public Static voidMain (string[] args) {triangle T=Newtriangle (); System.out.println (T.getperimeter ()); System.out.println (T.getarea ()); Triangle Q=NewTriangle (1.2,1.2,1.2); System.out.println (Q.getperimeter ()); System.out.println (Q.getarea ()); }}//Lader class classLader {DoubleSD;Doublexd;Doubleheight;Doublearea;//The following is a reference object Lader (DoubleSdDoubleXdDoubleheight) { This. sd=SD; This. xd=xd; This. height=height;} Public voidArea () { area=1.0/2* (SD+XD) *height; System.out.println ("Trapezoid area is:" +Area );}}//Circle Class classCircle {DoubleR;DoubleCircle;Doubles; Circle (DoubleR) { This. r=R;} voidArea () {Circle=2*math.pi*R;s=math.pi*math.pow (R, 2); System.out.println ("The circumference of the circle is:" +circle); System.out.println ("The area of the circle is:" +s);}}
Design a program, the program has three classes, triangle,lader,circle,