Question: The following code has to be done in C++ language. Objectives: Apply Software Engineering design and implementation concept and object class: Tic-Tac-Toe program Write a

The following code has to be done in C++ language. Objectives: ApplySoftware Engineering design and implementation concept and object class: Tic-Tac-Toe program Writea program that allows two players (X and O) to play theThe following code has to be done in C++ language.

Objectives: Apply Software Engineering design and implementation concept and object class: Tic-Tac-Toe program Write a program that allows two players (X and O) to play the tic-tac-toe game on a 3 by 3 two-dimensional array board. Some of the operations on a ticTacToe object are printing the current board, getting a move, checking if a move is valid and determining the winner after each move. Add additional operations as needed. You are giving the Tic Tac Toe.h header file with the ticTacToe class as follows: Tic Tac Toe.h header file #include using namespace std; enum status {WIN, DRAW, CONTINUE }; class ticTac Toe public: void play(); //Function to start the play. void display Board() const; //Function to print the board. bool isValidMove(int x, int y) const; //Function to determine if a move is valid. bool getxoMove(char moveSymbol); //Function to get a move for a player status gameStatus(); //Function to determine the current status of the game. void restart(); //Function to restart the game. ticTacToe(); 1/Default constructor. //Postcondition: Initializes the board to an empty state. //Postcode private: char board[3][3]; int noOfMoves; 1 2 3 Sample Output Player O enter move (row col): 31 1 2 3 Player O enter move (row col): 22 1 x 1 Player O enter move (row col): 2 3 1 2 3 1 x 0 x 2 x 01 3 2 x 010 Player X enter move (row col): 11 30 1 2 3 301 x | 1 x 1 Player X enter move (row col): 13 1 2 3 1 x | x Player X enter move (row col): 33 3 1 1 X 2 0 X 10 3 301 1 Player O enter move (row col): 2 2 2 XL 0 0 -H 301 x x Player O enter move (row col): 12 1 2 3 1 x 1 This game is a draw! 1 2 3 1 x 0x -- - 2 XL 3 3 0 1 1 Player X enter move (row col): 21 1 1 2 3 Player X enter move (row col): 32 1 2 3 1 x 1 1 X 0 X -- - To 2 X O 3 OLX

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!