Homework #4, Using Intrinsic Functions

(4 points)

In each of the following problems you will be provided with a sample program, that is missing a key calculation. Study the variable names that are provided as input or otherwise defined, look at the name of the variable or variables that are output, then find a pair of lines that look like this:

c----------------------------------------------------------------

c----------------------------------------------------------------
Insert an assignment statement or statements between these lines, containing the necessary intrinsic function to produce the correct results. In addition locate the "Modified by:" comment line and add your name and the date to the end of the line.

  1. The program height.f processes information from a laser ranging transit to determine the elevation change from ground level at the surveyor's location to the top of a mountain (h). The program input is the distance "d" from the transit to the mountain top and the angle "A" between horizontal and the line between the top of the transit and the mountain top. Output is the elevation change (h), accounting for the fact that the laser range finder is 5 feet above the ground.
  2. The program hypot1.f calculates the hypotenuse of a Right Triangle given the lengths of the other two sides. Use the appropriate intrinsic square root function in your assignment statement.

Leave your modified version of each of these files (don't change the file name) in your "homework" subdirectory. We will pick them up after the due date and test them.

Homework List / Home


Maintained by John Mahaffy : jhm@psu.edu