A First Programming Assignment

Now we come to the time to write our first program. For this assignment, you should write a program that read the lengths of the two legs of a right triangle from the user. Its output should be the length of the hypotenuse and the measure of the two (non-right) angles in the triangle. You may express the angles in radians or, if you're more ambitions, in degrees.

As this is your first program, I'll give you some required structure for this assignment. In particular, you should have a main program that handles the input and output. It should call one function that computes the length of the hypotenuse and one function that computes the size of an angle. This latter function should be called twice, once for each of the two angles other than the right angle. (Use your answer from Part 2-6 in the angle-computing function.) Computation of the hypotenuse can be done by using the Pythagorian theorem.

Enter, compile and run the program you write in the same manner as you did in Lab 0. Once you are satisfied that your program is correct, then print out a copy and turn it in to me. Don't forget to include substantial comments to your program including your name.

You can now return to the index or move on to the next part.