```
public class Hypotenuse
{
public double Hypo(double s1,double s2)
{
double hypotenuse = Math.sqrt(s1 * s2);
return hypotenuse;
}
}
```

```
import java.util.Scanner;
public class HypotenuseTest
{
public static void main(String[]args)
{
Hypotenuse h = new Hypotenuse();
System.out.println("The hypotenuse of Triangle 1 is :"+h.Hypo(3.0,4.0));
Hypotenuse h2 = new Hypotenuse();
System.out.println("The hypotenuse of Triangle 2 is :"+h.Hypo(5.0,12.0));
Hypotenuse h3 = new Hypotenuse();
System.out.println("The hypotenuse of Triangle 3 is :"+h.Hypo(8.0,15.0));
}
}
```

here's my code sir

well, you are basically all done. except that your formula for calculating hypotenuse is wrong. and, inside your main method you do not need to declare multiple instances of Hypotenuse objects. one would suffice.

p.s. what you are basically doing is finding the square root of 3*4 in the first case, which of course returns a number near 3.5

well, you are basically all done. except that your formula for calculating hypotenuse is wrong. and, inside your main method you do not need to declare multiple instances of Hypotenuse objects. one would suffice.

p.s. what you are basically doing is finding the square root of 3*4 in the first case, which of course returns a number near 3.5

He only uses 1 anyway(By accident I assume he forgot to change them once he copy pasted).

But yes, the only problem now is your formula for finding length of the hypotenuse of a right angled triangle.

What you have written basically means:*The hypotenuse is equal to the square root of the opposite side multiplied by the adjacent side.*

It should be:*The hypotenuse is equal to the square root, of the sum of, the square of each side*