If you order your assignment right now, you will be eligible for a great discount.

InstructionsCreate a C++ app that displays a checkerboard. Prompt the user for t

InstructionsCreate a C++ app that displays a checkerboard.
Prompt the user for t

InstructionsCreate a C++ app that displays a checkerboard.
Prompt the user for the char to use for light squares.
Prompt the user for the char to use for dark squares.
Use a two-dimensional array of char to prepare the checkerboard.
Your checkerboard should be a square (test and submit with 8 rows and 8 cols).
Write a function that traverses the array and displays each element.
Call your function to produce a checkerboard similar to the sample output below.
Use colored text and/or colored backgrounds if you wish. Color output is not required, but nicely done color output will score an additional 5 points.
Thought question: why not ask the user how big to make the checkerboard?
What to SubmitSubmit your completed .cpp file. If you used color, submit ansi_colors.h also.
Sample OutputThis sample output shows what your checkerboard should look like with ‘X’ for dark squares and ‘O’ for light squares. Note that prompts for user input are not included in this sample output.
Sample Color OutputIf you want to play with color output, get the checkerboard pattern working and submit your assignment first!
You can display colored letters, or you can go for a graphical effect like the sample output below.
Each square in this checkerboard is a string that contains foreground and background color codes (from ansi_colors.h) plus two blanks. I used a string sa[8][8] array plus two std::stringstream variables to set this up. There are other, maybe better ways to get this same effect. I used stringstreams because they’re not hard to manage.
What’s a stringstream?std::stringstreamLinks to an external site. is a C++ stream that works like cout and cin. Instead of streaming from/to the console like cin/cout, you can stream data into the stringstream and hold it for later use. A stringstream is bidirectional – you can also stream from the stringstream into a variable. Here’s a peek at how to use a stringstream for holding data:
// Code to set up the stringstream
std::stringstream ss_lite;
// stream foreground and background color codes
// plus two blank characters into the std::stringstream
// variable ss_lite.
ss_lite << FG_CYAN << BG_CYAN << " "; // When you prepare the checkerboard array, // put the stringstream data into each string array element ac2d[row][col] = ss_lite.str(); If you have any questions, please message me. Rubric Assignment 3 Rubric Assignment 3 Rubric CriteriaRatingsPts This criterion is linked to a Learning OutcomeRuns correctly according to the assignment instructions.Submitted code shows that you carefully followed the assignment instructions. All required features are present and each feature works correctly. 15 to >13.0 ptsGood job!
13 to >0 ptsNot yet…
15 pts
This criterion is linked to a Learning OutcomeFollows class coding standardUses appropriate and descriptive variable names and proper indentation. Has file comment header and main function comment header.
8 to >6.0 ptsGood job!
6 to >0 ptsNot yet…
8 pts
This criterion is linked to a Learning OutcomeSubmitted code compiles with no errors or warnings and runs without crashing.
8 ptsGood job!
0 ptsNot yet…
8 pts
This criterion is linked to a Learning OutcomeGood UXUser prompts are informative and presented neatly. Output is neatly formatted and easy to read. User interface follows a consistent scheme for a good User eXperience.
9 to >7.0 ptsGood job!
7 to >0 ptsNot yet…
9 pts
Total Points: 40
Previous

Default image
admin
Articles: 24945

Quick Quote

QUICK QUOTE