Question: CS 2 1 6 3 JAVA Assignment 4 Tic Tac Toe Assignment value: 4 0 points The assignment is a modification of Programming Exercise 8

CS 2163 JAVA
Assignment 4 Tic Tac Toe
Assignment value: 40 points
The assignment is a modification of Programming Exercise 8.9(Tic Tac Toe)
The program should first ask for the names of the two players. The program should then run
as a loop. As it is unfair for one player to always be X (and go first) alternate who gets to be
X and who gets to be O. Therefore, for each move the program should prompt the players by
name. As stated in the book, the program decides the outcome (X player wins, O player
wins, or tie game). Give a player 1 point for a win, and each gets (1)/(2) point for a tie game.
After each game, display the current score and ask the players if they want to play again.
How you handle this is up to you.
Include the following methods in your code:
public static void clearBoard()
// clears the board for a new game
public static void displayBoard()
// displays the current state of the board
public static void displayScore()
// display the current score
You may use other methods as you see fit, but do include the three above.
Variables used by several methods (such as the board) can be global.
This will turn out to be necessary once we start programming using GUIs.

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!