i i i
SOLUTIONS
,Contents
1 About This Solutions Manual
i i i1
1.1 To the Student . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i 1
1.2 To the Instructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i
2 Solutions to the Exercises i i i 3
Chapter 1 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i 5
. i i . i .
Chapter 2 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i 9
. i i . i .
Chapter 3 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i 17
. i i . i .
Chapter 4 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i 33
. i i . i .
Chapter 5 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i 75
. i i . i .
Chapter 6 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i 95
. i i . i .
Chapter 7 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 115
i i i i i i i i i i i i i i i
. i i . i .
Chapter 8 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 121
i i i i i i i i i i i i i i i
. i i . i .
Chapter 9 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 129
i i i i i i i i i i i i i i i
. i i . i .
Chapter 10 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 139
i i i i i i i i i i i i i i i
. i i . i .
Chapter 11 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 159
i i i i i i i i i i i i i i i
. i i . i .
Chapter 12 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 171
i i i i i i i i i i i i i i i
. i i . i .
Chapter 13 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 179
i i i i i i i i i i i i i i i
. i i . i .
Chapter 14 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 189
i i i i i i i i i i i i i i i
. i i . i .
Chapter 15 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 195
i i i i i i i i i i i i i i i
. i i . i .
Chapter 16 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 201
i i i i i i i i i i i i i i i
. i i . i .
Chapter 17 . . . . . . . . . . . . . . . . . .
i i i i i i i i i i i i i i i i i i i . i . i . . . . . . . . . . . . . . . . 207
i i i i i i i i i i i i i i i
. i i . i .
3 Extra Exercises and Their Solutions
i i i i 221
4 Teaching FORTRAN Programming
i i 259
@@SSee
isis
mmiciicsis
oolala
titoionn
, v
@@SSee
isis
mmiciicsis
oolala
titoionn
, 1
About This Solutions Manual i i i
1.1 To the Student i i
This Solutions Manual is intended for the instructor of a course that uses Classical FORTRAN
i i i i i i i i i i i i i i
as a textbook, and for the student who is learning the subject independently.
i i i i i i i i i i i i
If you are a student taking the course for credit you should know that it is a violation of
i i i i i i i i i i i i i i i i i i
academic ethics for you to consult this Solutions Manual, whether you copy verbatim from it or
i i i i i i i i i i i i i i i i
only use it to get ideas about how to work the exercises. The exercises are a valuable aid to
i i i i i i i i i i i i i i i i i i i
learning the material in the textbook, but only if you work them yourself ! Looking up the answers
i i i i i i i i i i i i i i i i i i
instead of figuring them out deprives you of an opportunity to learn the material. If an answer is
i i i i i i i i i i i i i i i i i i
for credit, cheating is also personally degrading to you and unfair to your classmates, and it
i i i i i i i i i i i i i i i i
imight place you in jeopardy of disciplinary action. If this is an illicit copy, please destroy it
i i i i i i i i i i i i i i i i
now. If this is a stolen copy, please return it to its rightful owner. Either way, STOP READING.
i i i i i i i i i i i i i i i i i i
If you are a student learning the subject by yourselfthen you are your own instruc-
i i i i i i i i i i i i i i i
tor. Please read the next section.
i i i i i
1.2 To the Instructor i i
This Solutions Manual is intended for the instructor of a course that uses Classical FORTRAN
i i i i i i i i i i i i i i
as a textbook, and for the student who is learning the subject independently.
i i i i i i i i i i i i
If you are in either category you should know that it greatly diminishes the usefulness of the
i i i i i i i i i i i i i i i i
exercises for graded work if their solutions become public. Please refrain from loaning this book
i i i i i i i i i i i i i i i
to others, distributing solutions to others, or posting solutions on the World Wide Web. If you
i i i i i i i i i i i i i i i i
want to show a group how to solve a problem, I suggest making a transparency or scanning to a
i i i i i i i i i i i i i i i i i i i
.pdf file for projection, or posting the solution in a display case under glass, so as to reveal
i i i i i i i i i i i i i i i i i i
the answer while discouraging photocopying or electronic scanning.
i i i i i i i i
At the same time, it is prudent for instructors to expect that some students will have access to
i i i i i i i i i i i i i i i i i
the solutions and thus an unfair advantage over their classmates who do not. If you suspect this
i i i i i i i i i i i i i i i i i
might be the case, you should consider assigning textbook exercises whose solutions are not
i i i i i i i i i i i i i i
included in this Manual or making up problems of your own, perhaps modeled on exercises in the
i i i i i i i i i i i i i i i i i
textbook.
i
Chapter 2 of this Manual provides solutions to about half of the exercises in the text, i i i i i i i i i i i i i i i
distributed in such a way as to represent each problem type in each chapter while favoring easy
i i i i i i i i i i i i i i i i i
problems and early chapters. Chapter 3 of this Manual contains some additional exercises and
i i i i i i i i i i i i i i
their solutions. Chapter 4 contains some materials that I have found useful in teaching
i i i i i i i i i i i i i i
programming from Classical FORTRAN.
i i i i
1
@@SSee
isis
mmiciicsis
oolala
titoionn