+1(978)310-4246 credencewriters@gmail.com
Select Page

I need someone to help me complete the attached computer programming assignment please. Instructions attached. Thank you!

COP 2210
Dr. Debra Davis
Assignment 5: Tic-Tac-Toe
For this assignment, you will be creating an interactive Tic-Tac-Toe game. You need
to remember what you have learned in class, lab, books and your assignments. Be
sure to refer to them when you need to.
There are 2 parts to this assignment. In the first part, you are going to be given a
problem and you will then need to create a structure, write algorithms and a flow
chart to solve it. In the second part, youÃ¢â‚¬â„¢ll be turning this into a java program.
So letÃ¢â‚¬â„¢s get started!
You love playing tic-tac-toe, but donÃ¢â‚¬â„¢t always have someone to play the game with.
So, you decide to create your own that you can play against the computer.
This will be a standard tic-tac-toe game with XÃ¢â‚¬â„¢s and OÃ¢â‚¬â„¢s where the players alternate
taking turns placing their tokens (i.e., X or O, depending on which one they are). It
will include:
Ã¢â‚¬Â¢ Standard 3 x 3 playing board (required: use 2D arrays)
Ã¢â‚¬Â¢ A winning game is either:
o 3 across
o 3 up and down
o 3 diagonally
Ã¢â‚¬Â¢ Tie games are possible if a winning game is not achieved.
Ã¢â‚¬Â¢ The game board with associated placement of the played XÃ¢â‚¬â„¢s and OÃ¢â‚¬â„¢s must be
displayed after each turn.
Program Flow:
Ã¢â‚¬Â¢ First, ask the user for their name and welcome them.
Ã¢â‚¬Â¢ Then randomly decide who will go first, the user or the computer (and let the
user know this)
Ã¢â‚¬Â¢ The user and computer will alternate turns placing their tokens.
o The user should be asked where they want to place their token
o The computer should be asked to randomly choose an empty spot
Ã¢â‚¬Â¢ The game ends when either a winning game occurs (see above) or all the
spots are filled.
Ã¢â‚¬Â¢ At the end of the game, ask the user if they would like to play again.
Input Options:
There are numerous options for getting input from users to indicate where they
want their token placed.
COP 2210
Dr. Debra Davis
Option 1: Ask them to give you the column and row number of their desired spot.
Option 2: Pre-fill each of the spots with a number, allowing users to select one
number to indicate their desired spot. For example:
1 | 2 | 3
__|___|__
4 | 5 | 6
__|___|__
7 | 8 | 9
|
|
For Part 1, create a class structure, algorithms and flow chart for your program, and
then do several iterations of tests (i.e., analyze it and step through to make sure that
it is logically correct). Also write the pseudocode for your tester class (where your
main will go). Put these in a Word or Open Office document. YouÃ¢â‚¬â„¢ll turn that
document in with the program that you create in Part 2.
Important! As you are working on this, be sure to break this down into smaller
pieces. Take it step-by-step, and donÃ¢â‚¬â„¢t try to finish this in one sitting. It will
make it MUST easier.
Part 2: Creating your Tic-Tac-Toe program
Once you are done revising and testing the class structure and algorithms, you are
ready to start modifying the code!
1. You should already have a Netbeans project. If you only have the source code,
you will need to create a project. HereÃ¢â‚¬â„¢s a nice tutorial on how to do that in
Netbeans. If you are using Dr. Java or Eclipse, just do a quick search on
youtube.com and youÃ¢â‚¬â„¢ll find lots of candidates.

Be sure to give your project a nice, meaningful name (and make sure it adheres to
JavaÃ¢â‚¬â„¢s naming conventions).
2. Once you have your shell ready, there are a few things to know before you start
Ã¢â‚¬Â¢ At the top of your class file, be sure to include the following:
COP 2210
Dr. Debra Davis
//********************************************************************************
// FIU EMAIL: [Your FIU email]
// CLASS: COP 2210 Ã¢â‚¬â€œ [Semester Year]
// ASSIGNMENT # [#]
// DATE: [Date]
//
// I hereby swear and affirm that this work is solely my own, and not the work
// or the derivative of the work of someone else, except as outlined in the
// assignment instructions.
//********************************************************************************
3. Now start translating your changes into java code.
Ã¢â‚¬Â¢ Remember to code and then compile frequently. It will make it easier to
find any bugs.
Ã¢â‚¬Â¢ Also remember that you will need a separate tester class (where your
main method will reside) if there is not already one.
i. Include the following code at the top of your class file (so that you
can use this class:
import java.util.Random;
http://java.sun.com/javase/7/docs/api/index.html (like you did in Lab
Assignment 2)
ii. YouÃ¢â‚¬â„¢ll need to use some variables. HereÃ¢â‚¬â„¢s how you get a random
number:
Random r = new Random();
int x = 1 + r.nextInt(10);
Upper limit of the random
number generated
Note that the number in the parens (e.g., 10 above) is the upper
limit of the random number. So, the random number that you get
here will be an integer between 0 and 10. Need a larger range? Just
change the 10 to the top of your range.
HereÃ¢â‚¬â„¢s another example, in this case if you are printing a random
number to the console:
System.out.print( 1 + r.nextInt(5) + ” ” );
4. Here is one more thing to do. Any input requested from the user and/or output
received from the user should be in a window (see E.1.14 and E.1.15 from lab 1).
At this point, you probably have your output going to the console. For your final
COP 2210
Dr. Debra Davis
submission, it needs to go to a window (JOptionPane). DonÃ¢â‚¬â„¢t forget any
additional libraries that you need to import to do this.
ThatÃ¢â‚¬â„¢s it! Now you your own interactive Tic-Tac-Toe game! Of course, youÃ¢â‚¬â„¢ll also need
to turn it in to Moodle.
Submission Requirements
You must upload a zip file to Moodle that includes your complete source project in
Netbeans, ready to load (We have been very lenient up until now regarding this.
From this assignment on, you will lose points if you do not include your complete
project.), and also contains the output in separate data files, and your Word/Open