Let's consider another, more direct example of a nested DO loop.
Suppose that you are to write a program to compute the average score for a set of students, each of whom has taken some number of examinations. Your program is to ask the user how many students there are and then, for each student,
How can we know that nested DO loops will be involved in this solution?
What is a structure plan for this program?
It is easy to see that this structure plan involves a nested loop.
Hamlet Project