(Square of Any Character) Modify the function created in Exercise 5.22 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:

#####
#####
#####
#####
#####
What will be an ideal response?


```
// Displays a solid square of input character.
#include
using namespace std;

void square( int, char ); // function prototype

int main()
{
int side; // input side length
char character; // fill character

cout << "Enter a character and the side length: ";
cin >> character >> side;
cout << '\n';

square( side, character ); // display solid square of input character
cout << endl;
} // end main
// square displays solid square of fillCharacter with specified side
void square( int side, char fillCharacter )
{
// loop side times for number of rows
for ( int row = 1; row <= side; row++ )
{
// loop side times for number of columns
for ( int col = 1; col <= side; col++ )
cout << fillCharacter;

cout << '\n';
} // end for
} // end function square
```

Computer Science & Information Technology

You might also like to view...

Which code example will calculate the number of checked items in a CheckedListBox named clbMovieNames and store the number in intCheckedMovies?

a. ```Dim intCheckedMovies As Integer = 0 intCheckedMovies = clbMovieNames.Items.Count – 1 ``` b. ```Dim intIndex As Integer Dim intCheckedMovies As Integer = 0 For intIndex = 0 To clbMovieNames.Items.Count – 1 If clbMovieNames.GetItemChecked(intIndex) = True Then intCheckedMovies += 1 End If Next ``` c. ```Dim intIndex As Integer Dim intCheckedMovies As Integer = 0 For intIndex = 0 To clbMovieNames.Items.Count – 1 If clbMovieNames.GetItemChecked(intIndex) = True Then lstChecked.Items.Add(clbCities.Items(intIndex)) End If Next ``` d. ```Dim intIndex As Integer Dim intCheckedMovies As Integer = 0 For intIndex= 1 To clbMovieNames.Items.Count If clbMovieNames.GetItemChecked(intIndex) = True Then intCheckedMovies += 1 End If Next ```

Computer Science & Information Technology

You can add the results of a query to an existing table by using a(n) _________ query

Fill in the blank(s) with correct word

Computer Science & Information Technology

You should store data in their ________ parts

Fill in the blank(s) with correct word

Computer Science & Information Technology

A(n) ________ describes all the possible values and likelihoods that a given variable can be within a specific range, and they can be in the form of a graph, table, or formula

A) continuous variable B) probability distribution C) observational unit D) discrete variable

Computer Science & Information Technology