I need to print a box out on the screen.
I am learning void functions (and have not learned about for yet)
I am able to print the top and bottom lines, but I just can not figure out how to get the 2 middle lines to print. I am giving this information in my instructions:
the interior dimensions are (numSigns-2) * (numSigns /2-2)
and the program promts for the number of $ for the top of the box. That number /2-2 lines are printed with $ on the sides;
Here is what i have so far:
void Print(int numSigns);
// FILL IN documentation.
int main ()
{
int number;
cout << "Enter the number of dollar signs for the top; "
<< "press return. " << endl;
cout << "Enter end-of-file characer to quit." << endl;
cin >> number;
while (cin)
{
/* FILL IN call to Print */
Print(number);
cout << endl;
Print(number);
cout << endl;
cout << "Enter the number of dollar signs for the top; "
<< "press return. " << endl;
cout << "Enter end-of-file characer to quit." << endl;
cin >> number;
}
return 0;
}
//*******************************************
void Print(int numSigns)
// FILL IN documentation.
{
/* FILL IN code to print numSigns $'s */
int count;
count = 0;
while (count <= numSigns)
{
cout << "$";
count++;
}
//********************************************
/* FILL IN code to print (numSigns / 2)-2 lines with */
/* $'s lining up under the left-most and right-most */
/* $ ones on the top line. */
/* FILL IN code to print numSigns $'s */
}
Please help....I have been at this all day!