Layout 1
Final Graded Project
Programming in Java
OVERVIEW XXXXXXXXXX1
YOUR PROJECT XXXXXXXXXX1
SUBMISSION GUIDELINES XXXXXXXXXX2
iii
C
o
n
te
n
ts
C
o
n
te
n
ts
1
OVERVIEW
Now that you’ve completed the study guide and required
textbook reading, you’re ready to finish the TicTacToe game
in the final project. You’ll add the application logic to handle
each turn and determine the outcome of the game.
Make sure that you follow all directions completely and verify
your results before submitting the project. Remember to include
all required components in your solution.
YOUR PROJECT
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.
. In the takeTurn method, use the getOutcome
method to determine whether to continue the game.
Programming in Java
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 cu
ent 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.
SUBMISSION GUIDELINES
For your project, you should submit the final JAR file:
TicTacToeGUIGame.ja
To ensure the JAR file is built, you should click the Build
utton or hit the F11 key.
To find the JAR file with NetBeans, you need to go to the
TicTacToeGUIGame project folder. To determine this folder,
ight-click on TicTacToeGUIGame project in the Projects
panel. Copy the value for the Project Folder textbox using
the keyboard shortcut CTRL+C. In Windows Explorer, paste
the project folder path and hit the ENTER key. Copy the
TicTacToeGUIGame.jar file from the dist folder to you
desktop or any other temporary location.
Follow this procedure to submit your project online:
1. Log on to the Penn Foster website and go to student por-
tal.
2. Click Take Exam.
3. Attach your file as follows:
a. Click on the Browse box.
. Locate the file you wish to attach.
Final Graded Project 2
c. Double-click on the file.
d. Click Upload File.
4. Enter your e-mail address in the box provided. (Note:
This information is required for online submissions.)
5. If you wish to tell your instructor anything specific
egarding this assignment, enter it in the Message box.
6. Click Submit File.
Grading Criteria
Your instructor will use the following guidelines to grade
your project.
Application behaves as expected 40 points
GUI meets the requirements 30 points
File contains no syntax e
ors 30 points
TOTAL 100 points
Congratulations! You’ve completed a simple application
with a GUI. You could expand on this game by adding more
graphics or animation or develop a new game like Connect
Four or Mastermind.
Now you’re ready to take on the larger world of Java
development!
Graded Project XXXXXXXXXX