Quote:

Write a Class to store information about Points.

Have a second class for a Triangle.

The instance variables for the Triangle class should be the three Points (yes, inside one class it is legal to have instance variables from another class)the lengths of the three sides, the Area and the Perimeter of the triangle.

To find the lengths of sides use the distance formula for the distance between two Points(in the point class there should be a method to find this distance).

To find the area you should use Hero's formula. Look up this formula on the Internet. It uses the lengths of the three sides and the semi-perimeter. This formula can be used to find the area of any triangle (it does not have to be a right triangle).

Allow the user to input (from the keyboard) the coordinates of the three Points.

Once these coordinates are input, declare three Points.

I would then have a constructor for the Triangle class that expects three Points.

Call this constructor with the three Points.

Have a method that could be used to call all other methods for computing the values of the other instance variables.

Have a toString to output all of the data about a Triangle. There should also be a toString method inside the Point class for the output of any Point object.

Ok, I understand that my Points class will need the methods to compute the distance, area, and perimeter, like so: