Implement a game of tic-tac-toe

Assignment Help JAVA Programming
Reference no: EM13698773

Question: Specify, design, and implement a class that can be one player in a Game of tic-tac-toe. The constructor should be specify whether the object is to be the first player (X's) or the second player (O's). There should be a member function to ask the object to make its next move, and a member function that tells the object what the opponent's next move is. Also include other useful member functions, such as a function to ask whether a given spot of the tic-tac-toe board is occupied, and if so, whether the occupation is with an X or an O. Also, include a member function to determine when the game is over, and wheit was draw, an X win, or an O win.

Use the class in two programs: a program that plays tic-tac-toe against the program's user, and a program that has two tic-tac-toe objects that play against each other.

Can you find the answer and please show me all the working and provide the answer.  

 

Reference no: EM13698773

Questions Cloud

Make an explicit statement of the invariant of the set class : Write a new container class called ser, which is similar to a bag, except that a set can contain only one copy of any given item, You will need to change the interface a bit. For example, instead of the bag's count function, you'll want a constant..
Explain the hydrangea flower was also mentioned : Question- In the video CIA Demonstration: Natural Acid-Base Indicators, red cabbage was demonstrated as a natural indicator, and the hydrangea flower was also mentioned.
Energy change for the transport of potassium ions : Question- 1) Calculate the free energy change for the transport of potassium ions from the nerve cells (15mM) to the blood plasma (400mM) at physiological temperatures
What volume of 0.200 m na2co3 solution contains na2co3 : Question- What volume of 0.200 M Na2Co3 (aq) solution contains 53.0 g of Na2Co3 Could you show the steps and equation
Implement a game of tic-tac-toe : Specify, design, and implement a class that can be one player in a Game of tic-tac-toe. The constructor should be specify whether the object is to be the first player (X's) or the second player (O's).
Calculate the nuclear binding energy : Question- Calculate the nuclear binding energy (in J) and the binding energy per nucleon for the following isotope K (39.96400 amu).
Show the closure under difference for regular languages : Show the closure under difference for regular languages but the proof was non-constructive.
Draw both mirror images of fluorochlorobromomethane : Question- Using the recessed bond and protruding bonds, as well as two regular straight-line bonds, draw both mirror images of fluorochlorobromomethane.
Explain what combination of a molecular base : Question- 1) What combination of a molecular base and a salt of the conjugate acid of the molecular base should you select to prepare a buffer solution that would maintain a pH of approximately 9.50. Please Explain.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Note the line number in the statement

Note the line number in the statement

  What are mobile oss you have personally used explain the

write a 200- to 300-word short-answer response to the following bull what are mobile oss you have personally used?

  Java program use breadth-first search closest broadcast

Write the java program which will use breadth-first search (which you implement as part of your program) to determine the closest broadcast vertex for each vertex in graph.

  Application for an animal-fur trimming service

Create an application for an animal-fur trimming service. Write the code for the application. Prompt the user to indicate how many animals. Display the total fee for one year. Be pleasant in your output as it will be expensive.

  Write java program to utilizes gui with five text fields

Write down the program called MaxMinAvgGUI.java which utilizes GUI with five(5)text fields which asks user to enter 5(five) decimal numbers. 1(one)number in each text field.

  A class is a blueprint for an object

A class is a blueprint for an object. A class may have a default constructor, a constructor with arguments, accessor methods, mutator methods, public fields, and private fields.

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  Program to translates a number into the closest letter grade

Write a program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better grade

  Prepare an app that calculates the product of a series

Prepare an app that calculates the product of a series of integers that are passed to method   product using a variable-length argument list.

  Test the invoice application

Study the error message and note the line number in the statement in the InvoiceApp class that caused the crash. Then click on the link to that line of the code.

  Objectives1 to practice defining classes using separate

objectives1. to practice defining classes using separate compilation.2. to practice using classes vectors and

  Micks wicks makes candles in various sizes create a class

micks wicks makes candles in various sizes. create a class for the business named candle that contains data fields for

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd