Computer Science
1107
AN INTRODUCTION
TO FORTRAN
PROGRAMMING
FOR SCIENTISTS AND
ENGINEERS
Fall 2001
Programming Assignment 11
Due date: Friday, November 30, 2001
Objective:
To explore writing a FORTRAN 77 program using multi-dimenstional
arrays.
Do Text Problem 7, Page 615.
In this problem, you will create what is called a "Magic Square."
Be sure to do the following:
- 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 lab11.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.
- Display your output using so that it looks like a magic square by
using formatted output.
- Be sure to test for correct input from the user.
- Run the program with n = 3, 5, 7, and 9.
- Check your results before creating your script file.
Then hand in the following:
- 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
NO required paragraph this time!.
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 programming 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.