changing psuedo code into a function

Hi

I am having a little difficulty turning my psuedocode into a function. My psuedocode is the following:

1
2
3
4
5
6
7
8
9
10
11
Prepare to read the file.
print main header
while (not at the end of the file)
   print the group header information
   while (number of lines printed is less than number to be printed)
       print a line of information
   end interior while
   print the group footer if any
end exterior while
print footer information.
close the file and otherwise clean up


I need to add this psuedocode to the function shown below so that it 'paginates' the report so that it displays it in blocks of 10 students.

1
2
3
4
5
6
7
8
9
void displayReport(StudentGroup arr, int howMany)
{
    for (int i=0; i<howMany; i++)
    {
        displayStudent(arr[i]);
        cout << endl;
    }
    cerr << "Finshed writing report\n";
}


Thanks if you can help me.
http://www.cplusplus.com/forum/articles/1295/
We don't provide homework solutions. We only assist those who have made a valid effort themselves.
Topic archived. No new replies allowed.