Question
USING C++ Practice with Two-Dimensional arrays Type in the following program: //Tic-Tac-Toe #include using namespace std; int main() { char ttt[3][3]; //initialize the board for
USING C++
Practice with Two-Dimensional arrays
Type in the following program:
//Tic-Tac-Toe
#include
using namespace std;
int main()
{
char ttt[3][3];
//initialize the board
for (int row = 0;row < 3; row++)
for (int col = 0; col < 3; col++)
ttt[row][col] = '?';
return 0;
}
1. Add code to print the tic tac toe board. Format it so that it prints correctly.
2. Add code to ask the user for the row and column and sets the element to an X.
3. Add code to print the new board.
4. Add code to ask the user for the row and column and sets the element to an O.
5. Add code to print the new board.
6. Would functions be useful here? Explain.
7. Add code to declare a 4x3 matrix.
8. Add code to input values for the matrix.
9. Add code to print the matrix.
10. Print the final program and sample output.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started