The triangle is a fascinating polygon. As simple as it looks, an amazing number of phenomena and computations can be made about it that range from the very simple to the very complex. A whole science, Trigonometry, is built on that simple triangle. The number of resources available to learn more about the geometric triangle in all types of media is probably infinite. However, below are some links to sites about triangles which are not only informative but also fun and amusing:
When you learn about the triangel you will notice that there is a number of ways to compute a single property of the triangle. For example, there are many ways of computing the area of a triangle given different sets of available information.
In this assignment we want to create a program that calculates the area if a triangle given only the lengths of the edges of a triangle. One formula for calculating the area of a triangle using only this is:
where A, B, and C are the lengths of the triangle's edges and
.
You are to write a FORTRAN77 program that accepts the lengths of the edges of a
triangle from the user and computes the corresponding triangle area. You do not
have to use the formulas above. You are welcome to search for and use other
formulas. However, your program should take and use only the lengths of the edges.
I forgot to tell you that not any values for the lengths can be valid for edges of a triangle. To be valid, the sum of any 2 of the 3 edges is supposed to be greater than the third edge. Your program is expected to validate the input before it computes the area. The program will post an error message and requests valid input. The program does not terminate until a valid input is given and the corresponding area is calculated.
Here is an examples of the program running:
Please input A, B, and C
1.0, 3.0, 1.0 <Enter>
Output:
Error: The values you entered for A, B, and C are invalid to form a triangle.
Please input A, B, and C
1.4, 3.5, 4.5 <Enter>
Area= 1.9293510
<Enter> represents the Enter key of the keyboard.
The user interface shown above is just an example. The design of your program's user interface is up to you.