// 9.14.1Knox.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include using namespace std; void GetInput(int&, int&); void PrintBox(int, int); int main() { int width, height; GetInput(height, width); PrintBox(height, width); } void GetInput(int& height, int& width) { cout << "Input the hieght of the box in charcters: "; cin >> height; cout << "\nInput the width of the box in charcters: "; cin >> width; cout << "\n\n"; return; } void PrintBox(int height, int width) { for (int y = 1; y <= height; y++) { for (int x = 1; x <= width; x++) { char out; if (x == 1 && y == 1) { out = (char) 218; } else if (x == width && y == 1) { out = (char) 191; } else if (y == height && x == 1) { out = (char) 192; } else if (y == height && x == width) { out = (char) 217; } else { if (y == 1 || y == height) { out = (char) 196; } else if (x == 1 || x == width) { out = (char) 179; } else { out = ' '; } } cout << out; } cout << endl; } }