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 project report in java

04/12/2021 Client: muhammad11 Deadline: 2 Day

Final Project Specification

COSC-1436 Programming Fundamentals I

Final Project
Version 1.6

March 9, 2020

Presented by:

Professor Keith Smelser

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 X OX

OXO X O O

OOX O O X

It does not check diagonal values.

XXO XOO

OXX X O X

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

3/9/2020 Service Specification Page 2

3/9/2020 Page 3

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:

Innovative Writer
Math Guru
A Grade Exams
Accounting & Finance Master
University Coursework Help
Write My Coursework
Writer Writer Name Offer Chat
Innovative Writer

ONLINE

Innovative Writer

As an experienced writer, I have extensive experience in business writing, report writing, business profile writing, writing business reports and business plans for my clients.

$45 Chat With Writer
Math Guru

ONLINE

Math Guru

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.

$44 Chat With Writer
A Grade Exams

ONLINE

A Grade Exams

I will provide you with the well organized and well research papers from different primary and secondary sources will write the content that will support your points.

$29 Chat With Writer
Accounting & Finance Master

ONLINE

Accounting & Finance Master

As an experienced writer, I have extensive experience in business writing, report writing, business profile writing, writing business reports and business plans for my clients.

$48 Chat With Writer
University Coursework Help

ONLINE

University Coursework Help

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

$49 Chat With Writer
Write My Coursework

ONLINE

Write My Coursework

I have read your project details and I can provide you QUALITY WORK within your given timeline and budget.

$41 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

What does contract administration mean - Duns tew drama group - Security Architecture and Design - 143 bus timetable cairns - Www ucumberlands edu ilearn - Exchange hunter jumper - Language awareness 12th edition answers - Diagnosis related groups are organized into - Xerox adapting to the turbulent marketing environment case study answers - Principles of distributed database systems 2nd edition pdf free download - Chapter Nine: Clash of Cultures - Designing a Training Program Instructions - Hardee miti mike side mower - Customer line item display in sap - How to find holes in a graph - Yeast two hybrid library - Classical conditioning examples on tv - Basic Python and Numpy Coding - Rubicam and young theory - Difference between mdf and idf - Unit 4-Discussion - British journal of management submissionbritish journal of management submission - Discuss how portrayals of violence in different media may affect human behavior - Understanding china's urban pollution dynamics - What nfl player has sickle cell anemia - Three grams of musk oil are required for each - How to calculate ripple voltage of full wave rectifier - Skull anatomy practice test - Flat roof ventilation terminals - Apothecary in to kill a mockingbird - Clinical significance - Tri component model of attitudes example - Compare and Contrast Delirium vs Dementia - Active listening techniques ppt - Program evaluation fitzpatrick 4th edition - St george bank term deposits - Broadmeadows library trading hours - Institutionalized organizations formal structure as myth and ceremony - Assignment and essay apa style - Baking soda and vinegar volcano - Grant v australian knitting mills facts - The primary reason for the popularity of lifo is that it: - ET WK4 - Kimberly clark good to great - Real Voodoo Psychic Lost Love Spells +27789489516 in Texas, Forth Worth | Bring back Lost love, Fix Broken Relationship instantly - Unit 5 Journal - Dutton park neighbourhood plan - IA week9 DB - Waren sports supply bank reconciliation - How to overcome cell phone addiction - Humanities through the arts 9th edition free pdf - Human resource management of nike - 2013 little india riot - The strike price of an option is - My life closed twice before its close by stanza summary - Which of the following statements best describes the term internal analysis? - Walmart global sourcing bangladesh - Sheep kidney dissection labeled - Arcadia tom stoppard act 1 - List three provisions in the corporate charter that affect takeovers - Best bubble gum for blowing bubbles - Ana cumple veintiún años - Pecha Kucha Storyboard - Major distinctions between zinn and schweikart - Sheep brain labeled diagram - Tlmt 601 - Communication - Population per square mile in china - Area under force-extension graph - Rutgers university undergraduate admissions - Describe your family's economic background examples - Art therapy in prisons - Brand Management- Essay question - Module 04 Discussion: Worker Protection - Seven stages of grieving characters - Can a cuban land crab outrun a horse - Hatchet chapter 17 summary - Barbie doll marge piercy tone - Clark ford watches prices in oman - Discussion Question - Baudrillard desert of the real - Mangerial Economics - A manufacturing company accumulates the following data on fixed overhead - Lesson plan on multiplication for grade 3 - Which of the following statements is true of organizational culture - Data domain file system cleaning - Avon community employment support centre - Venture budgeting and forecasting paper - 9.1 cellular respiration an overview - Sarah palin is a cunt - Healthcare Economic Week 4 Project - 4632 glencliffe road manlius ny - How to pronounce praxis - The film experience 5th edition pdf - Jarvis v swan tours ltd 1973 qb 233 case report - Tafesa adelaide city campus - Business Strategy - Hydraulic coefficient of orifice experiment - B and q bungee - Angels rest animal sanctuary