Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Tic tac toe java program

11/11/2021 Client: muhammad11 Deadline: 2 Day

Final Project Specification

Task
Enhance and correct a Tic Tac Toe game. The game is intended to be played against a computer.

The object TicTacToeBoard is initialized to indicate if the computer is the player 1 or player 2. Your task is to allow turns between the player and computer and to determine if a winner exists.

Keyboard input implies using the Scanner object.

Review Section 7.7 in the textbook.

Ideally, do 1 task at a time and test the results. The tasks are arranged so that the previous work will help with your testing.

The TicTacToeBoard class uses a Character class which is a wrapper class for char. It allows for the value null. Thus, the board values can be ‘X’,’O’ or null.

Deliverables
Submit the modified and corrected TicTacToe class and TicTacToeBoard class.

Be sure to submit both files. If you neglect to include a file, you must email me the missing file before the due date.

The file GuiBoard.java does not need to be included as there are no required changes.

Program Assumptions
The TicTacToeBoard is instantiated with the Computer as player 2. This setting also determines who is ‘X’ and who is ‘O’. ‘X’ always goes first.

In the TicTacToe board will have null values in the ‘squares’ when started.

Program Requirements
1. In the TicTacToe class and TicTacToeBoard class, modify the comment headers to include your name and student ID and semester.

2. In the TicTacToe class, set the existing Long variable named securityCode with a value as defined below. The TicTacToeBoard instance will do these validations for you. The program must simply load a number that qualifies. You may need to test this several times to create a qualifying security code.

a. securityCode must be a 16 digit number.

b. securityCode must start with the digit 2.

c. securityCode must not have sequential repeating digits.

i. Such as ‘4’ in 271744.

d. securityCode must not have sequential incrementing or decrementing digits. The next digit in the code cannot be 1 digit higher or 1 digit lower

i. Such as ‘45’ in 27145.

ii. Such as ‘54’ in 27154.

e. securityCode must contain every digit (0-9)

f. Being that securityCode is a Long variable type, it must be defined with a following L.

i. Long securityCode = 1234L.

g. You may optionally define the security code value with underscores for readability.

i. Long securityCode = 1234_4444_4444_4444L;

h. Do not prompt for a security code, it must be coded inside the TicTacToe class.

3. Create a loop in the TicTacToe class to play the game. This will be referred to as the ‘main’ loop for this process.

a. Create an int variable for row position. This declaration should be done only once and before the loop starts.

b. Create an int variable for column position. This declaration should be done before the loop starts.

c. Inside the loop, do the following tasks

i. Display “Your Turn” and prompt to enter a row number (0-2) to place your TicTacToe square.

ii. Prompt to enter a column number (0-2) to place your TicTacToe square.

iii. Call the setValue() method of the TicTacToeBoard instance with the input given.

1. setValue requires 2 parameters, Row and Column.

2. setValue is a boolean value method. It generates a true or false result. If the setValue method returns false, it was unable to process the request. When this occurs, display “Try again” and resume the loop at the beginning.

iv. Call the method hasWinner() of the TicTacToeBoard instance.

1. If hasWinner() returns true then

a. Call the method theWinnerIs() of the TicTacToeBoard instance and display the value returned from theWinnerIs() method as in the example below.

b. i.e. “The winner is X”

c. Exit the loop.

v. Call the method theComputersTurn() of the TicTacToeBoard instance. If this method returns a false value, display that “The computer has forfeited” and exit the loop.

vi. Do task iv again.

d. After the loop is completed – display “Game over” from the main() method.

4. The method setValue() in the TicTacToeBoard class can be called with out of range numeric values and create a runtime error. Modify the setValue method so that it returns false if data passed is not in the range of possible values. (0 – 2).

5. The TicTacToeBoard class does not have a way to indicate that all entries are loaded. Create a public method named hasSquaresAvailable() in the the TicTacToeBoard class that will report true if there are available squares or false is the board is full. (Review the existing checkFirstPlay() method for a similar example.)

a. Call this new method from the TicTacToe class inside the main loop.

i. Do this before calling setValue().

ii. Do this before calling theComputersTurn().

iii. If there are no remaining spaces then:

1. Display “No Available spaces”.

2. Terminate the loop.

6. The TicTacToeBoard class currently only checks rows and columns.

XXX XOX

OXO XOO

OOX OOX

It does not check diagonal values.

XXO XOO

OXX XOX

OOX OXX

a. Create a private method inside the TicTacToeBoard class named checkForDiagonalWin that will check for a possible diagonal win. This method does not need internal loops. Study how the private method checkRowOrColumnForWinner() works to understand what to look for. Be careful to check for null values before doing other compares as this can result in a null pointer exception.

b. Call the method created above in step 8a from the theWinnerIs() method in the TicTacToeBoard class.

5 points Extra Credit – Change the valid input range from 0 -2 to 1-3 for the row and column indicators as part of the processing in the TicTacToe class. Do not change the setValue method in the TicTacToeBoard class. All other work must be completed to receive extra credit.

Grading Rubric
Requirements
Percemtage
Working program with no crashes or run time errors.

No Eclipse Warnings – No TODOS, etc.

All COSC-Programming Guide Rules are honored.

25

Code contains useful comments. These can be per method and as desired.

5

Step 1

5

Step 2

5

Step 3

20

Step 4

15

Step 5

10

Step 6

15

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Homework Tutor
A+GRADE HELPER
Academic Master
Quick Finance Master
Peter O.
Custom Coursework Service
Writer Writer Name Offer Chat
Homework Tutor

ONLINE

Homework Tutor

I have assisted scholars, business persons, startups, entrepreneurs, marketers, managers etc in their, pitches, presentations, market research, business plans etc.

$36 Chat With Writer
A+GRADE HELPER

ONLINE

A+GRADE HELPER

I have assisted scholars, business persons, startups, entrepreneurs, marketers, managers etc in their, pitches, presentations, market research, business plans etc.

$48 Chat With Writer
Academic Master

ONLINE

Academic Master

I have written research reports, assignments, thesis, research proposals, and dissertations for different level students and on different subjects.

$38 Chat With Writer
Quick Finance Master

ONLINE

Quick Finance Master

I find your project quite stimulating and related to my profession. I can surely contribute you with your project.

$24 Chat With Writer
Peter O.

ONLINE

Peter O.

I reckon that I can perfectly carry this project for you! I am a research writer and have been writing academic papers, business reports, plans, literature review, reports and others for the past 1 decade.

$28 Chat With Writer
Custom Coursework Service

ONLINE

Custom Coursework Service

I can assist you in plagiarism free writing as I have already done several related projects of writing. I have a master qualification with 5 years’ experience in; Essay Writing, Case Study Writing, Report Writing.

$40 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

+971561686603 Abortion pills in Dubai/Abu Dhabi-mifepristone & misoprostol in DUBAI - The ebola wars general edition - The dynaco manufacturing company produces - A prayer for owen meany sparknotes - MG315 Discussion Post 5 - Ts3200 tape library express - Assignment 1: Explore Data Mining with Baseball Statistics - Data-driven decision making - Powerpoint Should Consist Of 18 Slides. Rubric Is Attached .PLEASE FALLOW THE RUBRIC - Object oriented data model ppt - Nursing - Iptv architecture block diagram - Which of the following examples best reflects an attitude as a learning outcome? - Principles of training individual differences - Eustis ucf - Weight loss patch instructions - Frankie wilde hear no evil album - Qv flare up cream guardian - Classic setx dream machine giveaway - Physics 1 - Reading comprehension with questions and answers pdf - PSYC Life Span Development Psychology - Embedded audit module examples - Truth focus statements the healing code - Delinquency - Most people from western cultures tend to ______ when conveying bad news or negative feedback. - Manage diversity in the workplace bsbdiv501 - Fidelity bank boca raton fl - Graveyard keeper stuck in church - 215 oldaker street devonport - Naming a covalent compound - David and goliath powerpoint - Area of a triangle worksheet - A lens is transparent material with _____ - Research Paper - How are accounting policies defined in the literature - End stopped line definition - Blog[Need To Watch A Video And Article] - Explore learning titration gizmo answers - The need for more than justice annette baier pdf - Ato painting rental property - Hbr marketing in the age of alexa - Anti-Trust Paper - healthcare organization that has been charged with an antitrust action - Mixing ammonia and sodium hydroxide - Give me liberty 5th edition test bank pdf - Health assessment - Drag the labels onto the diagram of the cns meninges - Kilgors - Making polymers lab report - Imitative new entry involves offering a radical new product or highly innovative service. - Week 3: The onset of data analysis - Business report title page - Queensland christian soccer association - Cascade control loop example - Lefkowitz v great minneapolis surplus store case brief - Trimdek foam infill strips - In pemdas is multiplication and division interchangeable - How are styrofoam cups made - Write equations of parallel and perpendicular lines calculator - Pearson statistics homework answers - S4 - Business Partner Development - Collaborative Learning Community Powerpoint - Ansi tia eia 644 - Expressed arguments in the media - The nature nurture debate the essential readings - Binder oven fd53 manual - Numerical Analysis -6 - Australian standards laundry practice and infection control - Brigance test score interpretation - What is innisfree known for - Case Study - Englisch hilfen present simple - Flow visualization lab report - I chop some parsley billy collins analysis - Biochemistry by garrett and grisham - Medical law and ethics quiz - Castillo company has a defined benefit pension plan - Pc unit 5 db deliver in 12hrsp - Disney parks and resorts strategy - ASSIGNMENT 8/9/20 - St malachy's nursery bangor - The man with the red sweater most likely represents - Australian journal of environmental education - Psychcentral com quizzes personality start php - Who were the sadducees pharisees and zealots - Suvat equations of motion - Brondecon cough mixture australia - Ethyl chloride boils at when liquid - International human resource management 5th edition pdf - Nursing capstone - Stocks with beta greater than 1 - Barbell medicine program review - E compensation tools in the job evaluation process - Week 1 CS quiz - QUALITATIVE Journal - Adventureworkslt2012 database - Relative reactivity of metals - HSE 6-2 - Fire extinguisher training pull aim squeeze sweep