#include #include using namespace std; int main() { cout << "How many rows of boxes (e.g., 10)? "; int nrows {0}; cin >> nrows; if (!cin) { cerr << "Sorry, that wasn't a number.\n"; return EXIT_FAILURE; } cout << "How many columns of boxes (e.g., 10)? "; int ncols {0}; cin >> ncols; if (!cin) { cerr << "Sorry, that wasn't a number.\n"; return EXIT_FAILURE; } cout << "How wide would you like to make each box (e.g., 1)?"; int colWide {0}; cin >> colWide; if (!cin) { cerr << "Sorry, that wasn't a number.\n"; return EXIT_FAILURE; } cout << "How deep would you like to make each box (e.g., 3)?"; int colDeep {0}; cin >> colDeep; if (!cin) { cerr << "Sorry, that wasn't a number.\n"; return EXIT_FAILURE; } for (int r {0}; r < nrows; ++r) { for (int c {0}; c < ncols; ++c) { cout << "+"; for (int bC {0}; bC < colWide; ++bC) { cout << "-"; } } cout << "\n"; for (int g {0}; g < ncols; ++g) { cout << "|"; for (int b {0}; b < colDeep; ++b){ cout << " "; } } cout << "\n"; } return EXIT_SUCCESS; }