1. Given a length of wire P units long, where P is an integer, it is possible in some cases to bend
    the wire into an isosceles triangle(with two sides equal) where the lengths of all the sides are
    also integers. For example a wire of length P = 3 units can be bent into an isosceles triangle,
    while a wire of length P = 4 can not. For some lengths there is more than one isosceles
    triangle with integer length sides. Of those isosceles triangles with integer length sides some
    will have an area which is also an integer, while others will not.
    The area of a triangle, given the lengths of its three sides a; b; c, is
    Area = m(m-a)(m-b)(m-c);
    where m = (a + b + c)/2.

(a) Write a function, which has as input an integer length P, and outputs(not prints) a
triple (a, b, A), where a is the integer length of the two equal length sides of an isosceles
triangle, b is the integer length of the other side, and A is the integer area of the
triangle. The function should output non-zero values (a,b,A) when there is ONLY
ONE isosceles triangle which has both integer length sides, and integer area,
otherwise it should return (0,0, 0). Test your function with P = 15, where the output
should be (0, 0, 0) and P = 16, where the output should be (5, 6, 12).

(b) Write a small program, using your function above, to print out all the lengths P, a, b
and Area A, in that order, of the first 12 unique triangles with integer sides and integer
area, such that P > 100. Do not print out the values where the output of your function
is (0; 0; 0).
You may only use the sqrt() and fix() Matlab functions for this question.

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in doing your homework for you.

DaniWeb Member Rules (which you agreed to when you signed up) include:
"Do provide evidence of having done some work yourself if posting questions from school or work assignments"

Post what you have done so far and someone will help you from there.

This article has been dead for over six months. Start a new discussion instead.