// roster_02.cpp // CS302 // James S. Plank // EECS Department, University of Tennessee // August, 2009 // #include "roster_02.h" 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 << "
" << names[i] << "
\n"; }