#include using namespace std; int main() { const int rows = 7; const int cols = 28; string message = "Display this centered in the box"; cout << "Here's a " << cols << "x" << rows << " rectangle:\n\n"; // write a nested for loop to generate this output: for ( int r = 0 ; r < rows ; r++ ) { for ( int c = 0 ; c < cols ; c++ ) { cout << '+'; } cout << endl; } // ++++++++++++++++++++++++++++ // ++++++++++++++++++++++++++++ // ++++++++++++++++++++++++++++ // ++++++++++++++++++++++++++++ // ++++++++++++++++++++++++++++ // ++++++++++++++++++++++++++++ // ++++++++++++++++++++++++++++ cout << endl; // display a hollowed-out box: for ( int r = 0 ; r < rows ; r++ ) { for ( int c = 0 ; c < cols ; c++ ) { if ( r == 0 || r == rows - 1 ) { cout << '+'; } else if ( c == 0 || c == cols - 1 ) { cout << '+'; } else { cout << ' '; } } cout << endl; } return 0; }