// roster_03.cpp // CS302 // James S. Plank // EECS Department, University of Tennessee // August, 2009 // #include "roster_03.h" Roster::Roster(int starting_number) { start = starting_number; } void Roster::Add_name(string name) { names.push_back(name); } void Roster::Print(int columns) { int i, c; c = 0; cout << "\n"; for (i = 0; i < names.size(); i++) { if (c == 0) cout << "\n"; // Start a new row when c = 0. cout << "" << endl; c++; if (c == columns) { // End the row when c == columns cout << "\n"; c = 0; } } if (c != 0) cout << "\n"; // If the last row is incomplete, end it. cout << "
"; printf("Filename: Pictures/%06d.jpg
", i+start); cout << names[i]; cout << "
\n"; }