Computer Science
1107
AN INTRODUCTION
TO FORTRAN
PROGRAMMING
FOR SCIENTISTS AND
ENGINEERS
Fall 2001
Programming Assignment 7
Due date: Monday, October 29, 2001
Objective:
To explore writing FORTRAN 77 programs using functions.
A. Text Problem 18, Page 380.
- Create a hand-drawn flow chart for the program using the appropriately
shaped boxes for start-stop, Input/Output, and computation as discussed
in class. (No pseudocode option this time.)
- Write the FORTRAN program, naming the source
code file lab7a.f and including an explicit list of all
variables as well as a short description of the problem in
a documentation section using comment
lines at the beginning of the program. Be careful to choose the types of
your variables appropriately and to include the names and student
numbers of all authors in the documentation section.
- Run the program with sufficiently many carefully selected sets of
input to demonstrate the correctness of your algorithm.
- Check your results before creating your script file.
B. Text Problem 19, page 381.
Use a function as was done in the Newton example.
- Create a hand-drawn flow chart for the program using the appropriately
shaped boxes for start-stop, Input/Output, and computation as discussed
in class OR write out the algorithm for the entire program using
pseudocode which should be written out by hand, not typed.
- Write the FORTRAN program, naming the source
code file lab7b.f and including an explicit list of all
variables as well as a short description of the problem in
a documentation section using comment
lines at the beginning of the program. Be careful to choose the types of
your variables appropriately and to include the names and student
numbers of all authors in the documentation section.
- Check your results before creating your script file.
Then hand in the following for each of your two programs:
- The flow chart OR the pseudocode listing.
- A script file containing all of the
following:
- A printout of the source program obtained by using the UNIX cat
command
- A compilation of the program obtained by using the f77
command
- Results of execution the program with the
given data sets obtained by using a.out
- A required paragraph which discussed the utility of functions and
subprograms.
Recall: For this and
all programming assignments you should follow good software engineering
principles including documenting your program with comments and using
meaningful names for variables. Failure to do this will lead to reduced
credit.
For this and subsequent assignments, you have the option of
working in teams of two people. In this case, turn in one copy of your
results with both names and student numbers included on every page of
every item
submitted.