Create construct instances for three separate triangles tr1


Referring to the in class RectangleClass example:

< RectangleClass>

class RectangleMain{ >

static void main(String[] args)> use to test < RectangleClass>

You will

Create a Class named and

RtTriangleMain { >

args)> to test your

The will:

1)Establish Two public double variables : leg1 and leg2 (initialize to 0.0)

2) You code will have three methods

1)Calculate the triangle area

2)Calculate the triangle perimeter

3)Find the hypotenuse for the right triangle

3) In the RtTriangleMain { >

you will create (construct instances) for three separate triangles (tr1, tr2, tr3) and assign positive values to leg1 and leg2 for each tringle.

1) Output leg1 and leg2 for each instance of all three triangles

2) Use all three methods defined in for each triangle and output the results.

There is no user input and all output is to the Console.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Create construct instances for three separate triangles tr1
Reference No:- TGS02914573

Expected delivery within 24 Hours