So, I'm trying to write code for a program that outputs stars (*) and spaces to create shapes based on an integer the user inputs. I was given a template in class but I honestly have no idea how to begin using voids. If anyone could help in anyway I'd be so appreciative!
voiid displaySquare(int n)
{
// print the upper bar
for (int i = 0; i < n; ++n) { cout << '*'; }
cout << '\n';
// print side bars
for( int i = 0; i < n-2; ++n)
{
cout << '*';
// print some of spaces
for( int k = 0; k < n - 2; ++k) { cout << ' '; }
cout << "*\n";
}
// print the lower bar
for( int i = 0; i < n; ++n) { cout << '*'; }
cout << '\n';
}