The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 5 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Pennfoster 402086 - A+ Solution
In this project, you ll finish the GUI version of the Tic-Tac-Toe
game. This project will require you to rewrite the application
logic found in the graded project for Lesson 2, but using object
orientation this time. In the instructions, code will be refer-
enced from the previous graded projects.
Instructions
1. In NetBeans, open the
TicTacToeGUIGame
project.
2. In the
TicTacToeGUIGame.java
file, make the following
changes to the
TicTacToeGUIGame
class:
a. Add a new method named
getOutcome
that returns
an
Outcome
enumeration. Use the
winOrTie
method in the Lesson 2 graded project as a guide.
b. In the
takeTurn
method, use the
getOutcome
method to determine whether to continue the game.
c. In the
takeTurn
method, display a dialog message
that displays the winner or tie when the game ends.
Optionally, you can clear the board and start a new
game after it ends.
Note:
You can use the following method to display a
dialog message in the current window:
JOptionPane.showMessageDialog (this, Both players tie. );
3. Build and run the project. Verify it works as expected.
Don t be discouraged if it doesn t run as expected right
away. Try tracing your steps and using
System.out.write
statements to figure out where you went wrong
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll