I am trying to create a program that uses nested loops to create a box. Only one of the overloaded functions need the details of nested loops.. the other 3 should call the one that has the details.. my problem is the last function and the for nested loops.
Here is what I have so far
***Code***
#include <iostream>
using namespace::std;
// Function prototypes
void displayBox ( int length );
void displayBox ( int length, char fillChar );
void displayBox ( int width, int height );
void displayBox ( int width, int height, char FillChar );
//--------------------------------------------------------------------
int main()
{
int boxLength, // Input box dimensions
boxWidth,
boxHeight;
char boxFill; // Input fill character
// Test the displayBox(length) and displayBox(length,fillChar)
// functions.
cout << endl << "Enter the length of a side: ";
cin >> boxLength;
displayBox(boxLength);
cout << endl << "Enter the fill character: ";
cin >> boxFill;
displayBox(boxLength,boxFill);
// Test the displayBox(width,height) and
// displayBox(width,height,fillChar) functions.
cout << endl << "Enter the width and height of the box: ";
cin >> boxWidth >> boxHeight;
displayBox(boxWidth,boxHeight);
cout << endl << "Enter the fill character: ";
cin >> boxFill;
displayBox(boxWidth,boxHeight,boxFill);
return 0;
}
//--------------------------------------------------------------------
void displayBox ( int length )
{
// call the 2 agrument function, int and char
char fill = " ";
displayBox(length, fill);
}
void displayBox ( int length, char fillChar )
{
// call the 3 argument function3
displayBox(length, length, fillChar);
}
void displayBox ( int width, int height )
{
// call the 3 argument function
char fil = " ";
displayBox(width, height, fill);
}
void displayBox ( int width, int height, char FillChar )
{
// using nested loops, write this function
}
***end of code***