1. Create a new Eclipse Java project.Call itTicTacToeFinal.
Copythepackagegames.boardfromyourLesson5projectinto the new project.
RenamethefileBoardGameTester.javatoTicTacToeGame.java. To do this, select the file in the Project Explorer, then chooseRefactor > Renamefrom the main menu.
IntheTicTacToeGame.javafile,intheTicTacToeGameclass, add a new method named getOutcome() that returns an Outcome enumeration. Use the winOrTie() method in the Lesson 2 graded project as a guide.
InthetakeTurn()method,intheTicTacToeGameclass,usethe getOutcome() method to determine whether to continue the game.
AlsointhetakeTurn()method,displayadialogmessagethat displays the winner or reports a tie when the game ends. When the dialog is dismissed, your program should terminate.
IntheBoard.javafile,intheBoardclass,modifythecatchblock in the setCell() method, which you added in Lesson 5, to use a dialog box to display the error. The program should continue when the dialog is dismissed.
Buildandruntheproject.Verifythatitworksasexpected.Don’t be discouraged if it doesn’t run as expected right away. Try tracing your steps and usingSystem.out.writestatements to figure out where you went wrong.
provide the following two files:
TicTacToeGame.jar
TicTacToeGame.java
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here