Modify the function created in question 6 above to form the square out of whatever character is contained in character parameter fillCharacter. Thus, if side is 5 and fillCharacter is #, then this function should print the following:
#####
#####
#####
#####
#####
#include <iostream>
using namespace std;
void print_square(int size, char fillCharacter)
{
for (int x = 0; x < size; x++)
{
for (int y = 0; y < size; y++)
cout << fillCharacter;
cout << endl;
}
}
int main()
{
print_square(5, '#');
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++