Question: I need to program a tic tac toe board with these guidelines in JAVA. Do not use a two-dimensional array of any kind or a

I need to program a tic tac toe board with these guidelines in JAVA. Do not use a two-dimensional array of any kind or a String. You must use a single-dimensional array of chars. Do not declare any variables globally. The board positions must be: 1 | 2 | 3 ---+---+--- 4 | 5 | 6 ---+---+--- 7 | 8 | 9 In addition to the main() method you should have these methods with the following headers: // prints the board (a) void printBoard(char board[]) // validate that a valid position was entered and that the position is not already occupied with an 'X' or'O'. It returns the correct board position number. (b) int nextPosition(char board[]) // Alternates 'X' and 'O', and returns 'X' or 'O'. (c) char markXorO(char XorO) // updates the board (d) void updateBoard(int position, char XorO, char board[]) // returns true if a winner is found else it returns false. (e) boolean isWinner(char board[]) (5) The program should print who won the game. Do not worry about ties. Here's a possible algorithm: initialize the board initialize 'X' or 'O' print the board do { get valid position update board print the board update the mark } while (there is no winner); print who won the game please help me out, i haven't started the code

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!