Question: Write a C++ program that creates a 6x6 checkerboard like the one shown in Figure 1 but then prints it rotated 90 degrees like the

Write a C++ program that creates a 6x6 checkerboard like the one shown in Figure 1 but then prints it rotated 90 degrees like the one shown in Figure 2. Your program must fulfill the following requirements:

1) You must use a two-dimensional char array to implement the board.

2) You must use a global constant variable (named constant) to specify the dimensions (rows and columns) of the array.

3) You must use nested loops to solve the problem.

4) Function main() must create the array and then call the three functions specified below:

A) createBoard(): receives the array from main() and returns it filled with the chec

kerboard.

B) printBoard1(): receives the array from main() and prints it as is (see Figure 1).

C) printBoard2(): receives the array from main() and prints it rotated 90 degrees (see Figure 2).

Hints:

1) Remember that you can assign to a char variable a whole number corresponding to the ASCII code of the character that you want to store in it.

2) Once you figured out how to create the checkerboard, printing it as in Figure 1 is pretty straight forward. To print it like in Figure 2 you need to make minor changes.

Example: https://imgur.com/a/ismtc

Important:

-You must choose the most appropriate data types for your variables, parameters, and functions.

-When you pass an array to a function make sure you pass it in the most appropriate way (const or not const).

-The best way to know if you implemented these programs correctly is to compile your code and run it to see if it works as expected. Run my solution to see what your program must do.

To solve this problem take the four Polyas Problem Solving Steps:

1. Understand the problem:

Draw the 6x6 array with row and column numbers to understand what you need to do.

2. Devise a plan for solving the problem:

Think abstractly! Describe in pseudocode (or plain English if necessary) what you need to do.

Divide and Conquer! Solve one function at a time.

Relax some of the problem constraints! Start displaying just a character (like a # for example) instead of the letters. Once you figured out how to create the checkerboard with the #, then think how to display the letters in alphabetical order starting at A.

Reuse solutions! Once you figured out how to print the array as it was created, think how to modify this solution to display the array rotated.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!