Write a C++ program using functions that accepts a single integer value entered by the user. If the value entered is less than one, the program prints nothing. If the user enters a positive integer, n, the program prints an nn box drawn with * characters. If the users enters 1, for example, the program prints
*
If the user enters a 2, it prints
**
**
An entry of three yields
***
***
***
and so forth. If the user enters 7, it prints
*******
*******
*******
*******
*******
*******
*******
that is, a 7 X 7 box of * symbols.
Alright well you edited your post with a new problem.
I'd suggest making a new post instead.
Let's see if I can do this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
usingnamespace std;
int main()
{
int boxsize;
cout << "Please enter an integer value for the size of box " << endl;
cin >> boxsize;
for (int i = 0; i < boxsize; i++)
{
for (int j = 0; j < boxsize; j++)
cout << "*";
cout << endl;
}
return 0;
}