Assignment #2 - 93A

Assignment #2 - 93A


Assignment #2
=============

Due: Monday 1st February 1993
Weight: 20
E-Mail to:  HQHK
T.A. = Lucie Bernier    McConnell 322  Mon and Fri 13:00 - 15:00


Write a FORTRAN program to read in set of three real numbers that
represent the lengths of the sides of a triangle.  If these lengths are
A  B  C  then the perimeter is A+B+C.
The Semi-perimeter S is half the perimeter.

The AREA of the triangle is given by:
Area= Square Root (S(S-A)(S-B)(S-C))

For each triplet of three numbers, check that they form a triangle.
That is, negative length of sides are not allowed, and no one
side should be greater than the sum of the other two sides.
If the triplet does not form a triangle, print an error message
and go onto the next case.  Use a set of three zeros to finish
the program.

Your output should include the values of A, B, and C, the perimeter
and area if one exists.

Sample data - copy the following data into your own program:

/DATA
 2.5 4.5 5.5
 3.6 7.1 6.78
-1.2 2.43 2.2                     Checking for negative sides.
 2.0 3.0  13.0  One side too long?
 12.0 2.0 5.0   And this one?
 4.0 3.0 5.0    Who was Pythagoras anyway?
 0.0 0.0  0.0   End of File indication