(Checkerboard Pattern) Display the following checkerboard pattern with eight output statements, then display the same pattern using as few statements as possible.
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
What will be an ideal response?
```
#include
using namespace std; // program uses names from the std namespace
int main()
{
// Eight output statements
cout << "* * * * * * * *\n";
cout << " * * * * * * * *\n";
cout << "* * * * * * * *\n";
cout << " * * * * * * * *\n";
cout << "* * * * * * * *\n";
cout << " * * * * * * * *\n";
cout << "* * * * * * * *\n";
cout << " * * * * * * * *\n\n";
// One output statement; 3 parts
cout << "* * * * * * * *\n * * * * * * * *\n* * * * * * * *\n"
<< " * * * * * * * *\n* * * * * * * *\n * * * * * * * *\n"
<< "* * * * * * * *\n * * * * * * * *\n";
cout << endl; // ensure everything is displayed
} // end main
```
You might also like to view...
Which is not one of four steps that a systems analyst must follow to design a good sample?
A) Determine the data to be collected or described. B) Determine the population to be sampled. C) Choose the type of population. D) Describe the sample size.
If you use the Windows Snipping Tool to capture the entire screen, the taskbar is included in the snip
Indicate whether the statement is true or false
If the bottom row of a table is formatted differently from the other rows in the table, it is being used as a(n) ________ row
Fill in the blank(s) with correct word
HTML
A. is the document format used to produce Web pages. B. controls Web browsers that access the Web. C. is used to connect to Usenet groups on the Internet. D. is used to transfer text files, programs, spreadsheets, and databases across the Internet. E. is a low-level encryption scheme used to secure transmissions in higher-level () format.