Question: Specify, design, and implement a class that can be one player in a Game of tic-tac-toe. The constructor should be specify whether the object is to be the first player (X's) or the second player (O's). There should be a member function to ask the object to make its next move, and a member function that tells the object what the opponent's next move is. Also include other useful member functions, such as a function to ask whether a given spot of the tic-tac-toe board is occupied, and if so, whether the occupation is with an X or an O. Also, include a member function to determine when the game is over, and wheit was draw, an X win, or an O win.
Use the class in two programs: a program that plays tic-tac-toe against the program's user, and a program that has two tic-tac-toe objects that play against each other.
Can you find the answer and please show me all the working and provide the answer.