Question: write a c++ program Use a two-dimensional array to implement a Tic-Tac-Toe game. Use an object-oriented approach. Suggestions: Define a TicTacToe class. The data structure

write a c++ program Use a two-dimensional array to implement a Tic-Tac-Toe game. Use an object-oriented approach. Suggestions: Define a TicTacToe class. The data structure will be a 3x3 array (the board) to hold the current state of the game Define functions to Update the board with 'X' or 'O' Determine if there is a win Print the board on the screen Implement the interface with the user and logic of the game in main. The board should be printed on the screen after each update. Generate one file with the TicTacToe class and main at the end. This will be the only file you will turn in.

i did like this , can you help me finished it?

#include using namespace std;

class TicTacToe { private: char grid[3][3]; bool rowWin(); bool colWin(); public: TicTacToe(); void update(int row, int col); void print()const; bool win() const; };

TicTacToe::TicTacToe() { }

void TicTacToe::update(int row, int col) { }

void TicTacToe::print()const { }

bool TicTacToe::win())const { return true; }

int main() { TicTacToe ttt; int row, col; ttt.update(row,col) return 0; }

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!