/* * This is a program from the book. */ #include #include using namespace std; const string BLACK = "********"; const string WHITE = " "; const char NEWLINE = '\n'; int main() { string blackLine; string whiteLine; string blackBlock, whiteBlock; // construct a black line. // |******** ********...... blackLine = BLACK + WHITE + BLACK + WHITE + BLACK + WHITE + BLACK + WHITE; // construct the white line. whiteLine = WHITE + BLACK + WHITE + BLACK + WHITE + BLACK + WHITE + BLACK; // consturct the rows of squares. blackBlock = blackLine + NEWLINE + blackLine + NEWLINE + blackLine + NEWLINE + blackLine + NEWLINE + blackLine + NEWLINE; whiteBlock = whiteLine + NEWLINE + whiteLine + NEWLINE + whiteLine + NEWLINE + whiteLine + NEWLINE + whiteLine + NEWLINE; // print the results. cout << whiteBlock; cout << blackBlock; cout << whiteBlock; cout << blackBlock; cout << whiteBlock; cout << blackBlock; cout << whiteBlock; cout << blackBlock; cout << endl; return 0; }