#include <iostream>
using namespace std;

void box(short wide, short high, bool hollow);

inline void pause(void)
{
    char t;
    cout << "Press a key and Enter to continue:  ";
    cin >> t;
    return;
}

int main(void)
{
    cout << "A solid box 4x10:\n\n";
    box(10, 4, false);
    pause();
    cout << "A hollow box 6x25:\n\n";
    box(25, 6, true);
    pause();
    return 0;
}

void box(short wide, short high, bool hollow)
{
    short w, h;
    for (w = 0; w != wide; w++)    // top
    {
        cout << '*';
    }
    cout << endl;
    for (h = 1; h != high-1; h++)
    {
        cout << '*';                    // side
        for (w = 1; w != wide-1; w++)    // middle
        {
            cout << (hollow ? ' ' : '*');  // hollow or solid?
        }
        cout << '*' << endl;            // side
    }
    for (w = 0; w != wide; w++)    // bottom
    {
        cout << '*';
    }
    cout << endl;
    return;
}
