Hey I randomly saw this post and registered to help out. It says here no cheating allowed but um im not really sure what exactly that would be. anyways i went to my last semester program folder and took out the draw function out, and made changes to fit what you wanted. maybe it can
help you a bit.
CODE
void rect(int Length, int Width)
{
char Border='*';
char Fill=' ';
for (int L=0;L<Length;L++)
{
cout << Border;
if(L==0 || L==Length-1)
{
for (int W=0;W<Width-2;W++)
cout << Border;
}
if(L>0 && L<Length-1)
{
for (int W=0;W<Width-2;W++)
cout << Fill;
}
cout << Border;
cout << endl;
}
}
Thats the function you asked for. The code below is the rest of the program, it asks for the user to input a length and width. If you need you can also make it so it asks for the border character and the filling character but you'll have to do that.
CODE
#include<iostream>
using namespace std;
void rect(int, int, char, char);
int main()
{
char border='*';
char fill=' ';
int length;
int width;
cout << "Length: ";
cin >> length;
cout << "Width: ";
cin >> width;
rect(length, width, border, fill);
return 0;
}
Just take that and put it before the function and compile, should all work.