For this exercise, you will complete the TicTacToe Board that we started in the 2D Arrays Lesson.

We will add a couple of methods to the TicTacToe class.

To track whose turn it is, we will use a counter turn. This is already declared as a private instance variable.

Create a getTurn method that returns the value of turn.

Other methods to implement:

printBoard()- This method should print the TicTacToe array onto the console. The board should include numbers that can help the user figure out which row and which column they are viewing at any given time. Sample output for this would be:

0 1 2
0 - - -
1 - - -
2 - - -
pickLocation(int row, int col)- This method returns a boolean value that determines if the spot a user picks to put their piece is valid. A valid space is one where the row and column are within the size of the board, and there are no X or O values currently present.
takeTurn(int row, int col)- This method adds an X or O to the array at position row,col depending on whose turn it is. If it’s an even turn, X should be added to the array, if it’s odd, O should be added. It also adds one to the value of turn.
checkWin()- This method returns a boolean that determines if a user has won the game. This method uses three methods to make that check:

checkCol- This checks if a player has three X or O values in a single column, and returns true if that’s the case.
checkRow - This checks if a player has three X or O values in a single row.
checkDiag - This checks if a player has three X or O values diagonally.
checkWin() only returns true if one of these three checks is true.

public class TicTacToeTester
{
public static void main(String[] args)
{
//This is to help you test your methods. Feel free to add code at the end to check
//to see if your checkWin method works!
TicTacToe game = new TicTacToe();
System.out.println("Initial Game Board:");
game.printBoard();

//Prints the first row of turns taken
for(int row = 0; row < 3; row++)
{
if(game.pickLocation(0, row))
{
game.takeTurn(0, row);
}
}
System.out.println("\nAfter three turns:");
game.printBoard();



}
}

public class TicTacToe
{

private int turn;
private String[][] board = new String[3][3];

public TicTacToe()
{
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 3; j++)
{
board[i][j] = "-";
}
}
}

//this method returns the current turn
public int getTurn()
{
return turn;
}

/*This method prints out the board array on to the console
*/
public void printBoard()
{

}

//This method returns true if space row, col is a valid space
public boolean pickLocation(int row, int col)
{
return true;
}

//This method places an X or O at location row,col based on the int turn
public void takeTurn(int row, int col)
{

}

//This method returns a boolean that returns true if a row has three X or O's in a row
public boolean checkRow()
{
return true;
}

//This method returns a boolean that returns true if a col has three X or O's
public boolean checkCol()
{
return true;
}

//This method returns a boolean that returns true if either diagonal has three X or O's
public boolean checkDiag()
{
return true;
}

//This method returns a boolean that checks if someone has won the game
public boolean checkWin()
{
return true;
}

}

Answers

Answer 1
ndjdjdbzkdkekkdjdjdkodododofiifidididiidieiekeieidid

Related Questions

URGENT!!! DUE IN 5 MINUTES!!!!!

Why do we need things like sequence, selection, iteration, and variables. Why are they needed in Coding? Why are variables important?

Answers

Answer:

Sequencing is the sequential execution of operations, selection is the decision to execute one operation versus another operation (like a fork in the road), and iteration is repeating the same operations a certain number of times or until something is true.

Explanation:

Which type of testing is used to test how well the system will perform with a workload?

Integration testing

performance testing

unit testing

acceptance testing

Answers

Answer:

Performance Testing

Explanation:

The Correct option is - Performance Testing

Reason -

INTEGRATION TESTING is a level of software testing where individual units / components are combined and tested as a group. The purpose of this level of testing is to expose faults in the interaction between integrated units.

PERFORMANCE TESTING  is a testing measure that evaluates the speed, responsiveness and stability of a computer, network, software program or device under a workload.

UNIT TESTING is a type of software testing where individual units or components of a software are tested. The purpose is to validate that each unit of the software code performs as expected.

Acceptance testing, a testing technique performed to determine whether or not the software system has met the requirement specifications.

so this is what i use to code and all of that

Answers

Answer: yeah!

Explanation:

Have a good day!

Give two benifets to the supermarket maneger and two benifets of customers of using barcods on all items

Answers

Answer:

The benefit of barcodes on items for the manager and the customers are as follow-

Explanation:

Benefits of using bar codes on all items to the manger are as follow -

The process of customer dealing increases by quickly scanning the item, rather than manually noting down the details.The track record of all the items can be maintained properly.

Benefits of using bar codes on all items to the customers are as follow -

The time period to purchase any item increases, hence the customer can shop for many items in short span of time.The chances of any mistake gets reduced, as everything is done digitally.

HELP!!!!!
Match the term and definition. An address that refers to another
location, such as a website, a different slide, or an external file.
Active Cell
Hyperlink
Clipboard
Insertion Point

Answers

Answer:

Hyperlink

Explanation:


Which specialized information system is used by passport agencies and border inspection agencies to check the names
of visa and passport applicants?

Emergency Department Information Systems

Superfund Information Systems

Consular Lookout and Support Systems

Geographic Information Systems

Answers

Answer:

Consular Lookup and Support System

please answer no files !!

Answers

Answer:

im not exactly sure but i think its c

Explanation:

Please help
What are keywords?

Answers

Keywords are the words and phrases that people type into search engines to find what they're looking for.

image

Determine the value of x in the figure.
Question 1 options:

A)

x = 135

B)

x = 90

C)

x = 45

D)

x = 85

Answers

Answer:

B. x = 90

Explanation:

180 = 135 + yy = 4545 + 45 = 90

the corner above 135 is 45 so the other side that isnt x is also 45, leaving a total of 90 degrees left, making x 90 degrees

x=90°

how many colors are in microsoft word?

Answers

Answer:

4 Owo

Explanation:

XOXO

Kit

Select the correct text in the passage.
Select the appropriate guidelines to create and manage files in the passage given below. (In parentheses)

Guidelines for organizing files and folders
First, (select a central location to organize all your files, folders, and sub-folders).
Then double-click the folder or folders to identify which file you want to move. Now (use Windows Explorer to navigate and paste the file in the
required location).
Effective file management helps reduce the stress of looking for files and saves you a lot of time. All file types have unique file extensions that helpyou (determine which program to use to open a particular file and to access its data.)
If your computer crashes, all files and folders on the desktop are lost and it is often impossible to recover them. You should (maintain your
personal and professional files separately.) The file system on your computer already (keeps track of the date the file was created and modified,)
Therefore, chronological sorting is not necessary.
It is a great idea to (categorize your data into folders.) It is even better to (segregate them further into sub-folders.) If you maintain a list of
sub-folders under every main folder, you will be able to access all your tasks easily. For example, you could put your school subjects under
different sub-folders to organize your data efficiently on your computer.
Any file you create and use should have a proper description. It is important to create accurate names for each file, especially if you have a large
number of files in a folder, and you need to (select a single file to work on.)

Answers

Answer:

The appropriate guidelines to create and manage files in the passage:

O.  First, (select a central location to organize all your files, folders, and sub-folders).

O.  Then double-click the folder or folders to identify which file you want to move.

O.   Now (use Windows Explorer to navigate and paste the file in the

required location).

The correct text in the passage is:

O.   It is a great idea to (categorize your data into folders.) It is even better to (segregate them further into sub-folders.) If you maintain a list of  sub-folders under every main folder, you will be able to access all your tasks easily. For example, you could put your school subjects under  different sub-folders to organize your data efficiently on your computer.

Explanation:

Answer:

Behold.

Explanation:

Write a program to find all integer solutions to the equation 4x + 3y -9z = 5 for values of x, y, and z between 0 to 100.

Answers

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

  int c= 0;//defining integer variable to count number of solutions

  int x,y,z;//defining integer variable which is used in the loop

  for (x = 0; x <= 100; x++)//defining for loop to x value

     for (y = 0; y <= 100; y++)//defining for loop to y value

        for (z = 0; z <= 100; z++)//defining for loop to z value

           if (4 * x + 3 * y - 9 * z == 5)//use if to check given condition

           {

              c++;//increment count value

              cout << "(" << x << "," << y << "," << z << ")";//print solutions  

              cout << (c % 11? " " : "\n");//use for add file solution in a row

           }

  cout << "\n\nThere are " << c << " solution(s)\n";//print solution couts

  return 0;

}

Output:

Please find the attached file.

Explanation:

In the above-given code four integer variable "x,y,z, and c" is declared, in which "x,y, and z" is used in the for loop with the if conditional statement that checks the given condition and prints the solution and the "c" variable is used to counts the number of solution, and at the last, it uses the print method to print its values.  

At what point of a project does a copy right take effect?
Creation
Publishing
Research
Brainstorming

Answers

The correct answer is B Publishing
The answer is publishing

What legal protection would cover a person invention?
Plagiarism
A trademark
A copy right
A patent

Answers

Answer:

Option 4, A patent

According to Wikipedia, a patent is defined as, "A title that gives its owner the legal right to exclude others from making, using, or selling an invention for a limited period of years in exchange for publishing an enabling public disclosure of the invention."

D. A patent.
Have an amazing day!

The contrast ratio of blue 80 text on a yellow-10 background is __ to 1.

80

8

70

4

Answers

Answer:

The Answer is 8...

Explanation:

Answer:

8

Explanation:

80/10= 8

5
Type the correct answer in the box Spell all words correctly.
Which kind of devices uses radio waves to transport data?
devices use radio waves to transport data.
Reset
Next

Answers

Answer:

RF devices use radio waves to transport data

Explanation:

RF devices are used to refer to equipment in the wireless communication industry that transmit data and sound using radio frequency waves from point to point. Network devices that alternatively transmit data signals over a distance using radio waves and not telephone lines or data cables are known as RF devices.

The Open Systems Interconnection (OSI) Reference Model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (WLAN) communication protocols. details the advantages and disadvantages of various basic network cabling options.

Answers

Answer:

is a generic description for how computers use multiple layers of protocol rules to communicate across a network.

Explanation:

OSI model stands for Open Systems Interconnection. The seven layers of OSI model architecture starts from the Hardware Layers (Layers in Hardware Systems) to Software Layers (Layers in Software Systems) and includes the following;

1. Physical Layer.

2. Data link Layer.

3. Network Layer.

4. Transport Layer.

5. Session Layer.

6. Presentation Layer.

7. Application Layer.

Hence, the Open Systems Interconnection (OSI) Reference Model is a generic description for how computers use multiple layers of protocol rules to communicate across a network.

Additionally, each layer has its unique functionality which is responsible for the proper functioning of the communication services.

Describe the difference between the circumscribed and inscribed options when using the AutoCAD Polygon command

Answers

Answer: Describe the difference between circumscribed and inscribed options when using the autocad polygon tool. Circumscribed draws the object around the circle while inscribed draws the object inside the circle. The Length is equal to 5.3151 and the Angle is equal to 41 degrees.

Explanation:

If you selected row 17 and then selected Insert Sheet Rows, row 17 _____.
a.
is deleted
b.
becomes row 18
c.
becomes row 16
d.
is moved to the top of the worksheet

Answers

Answer:

that answer is a and all that is the math

thick is incorrect does anybody know the correct answer? please don’t send any files i can’t open them

Answers

Answer:

i think its new

Explanation:

if this is incorrect i apologize

Which titles fits this Venn diagram best?

A Venn diagram with 2 circles. The left circle is titled Title 1 with entries a group of occupations with similar tasks; examples: law enforcement, agriculture, pharmaceuticals. The right circle is titled Title 2 with entries a specific set of responsibilities and tasks performed; examples: waitress, peach farmer, police dispatcher. The middle has entries involve a person's daily work, done to earn money.

Title 1 is “Jobs” and Title 2 is “Careers.”
Title 1 is “Careers” and Title 2 is “Jobs.”
Title 1 is “Self-Employed” and Title 2 is “Company-Employed.”
Title 1 is “Company-Employed” and Title 2 is “Self-Employed.”

Answers

The answer is You looking for is C

Answer:

B. Title 1 is “Careers” and Title 2 is “Jobs.”

Explanation:

edg 22 unit test in career explorations A

Choose the words that complete the sentences.
A_______
is used to edit raster images.

A_______
is used to edit vector images.
A_______
is used to control a scanner or digital camera.

Answers

Answer:

A paint application

is used to edit raster images.

A drawing application

is used to edit vector images.

A  digitizing application

is used to control a scanner or digital camera.

Explanation:

got it right on edg

The study and practice of information storage and retrieval is called

Answers

Information Science

3. Output the following:
a.
21%4​

Answers

Answer:

21 % 4 is 24 modulus 4. The remainder you get when you divide 21 by 4. 21 divided by 4 is 5, remainder 1.

So, 21 % 4 = 1.

data can only be entered maually into a computer true or false​

Answers

Answer:

True :)

Explanation:

Answer:

True

Explanation:

You can stick a flash drive into a computer but you have to manually transition the files from the flash drive into the computer.

An essential field which is central to Artificial Intelligence research is?

Answers

Answer:

The appropriate answer is "Due Diligence".

Explanation:

Throughout terms of monitoring an arrangement or a contract, conducting legal analysis, or execute electronic investigation or exploration tasks.Legal software seems to be the amount of precaution or vigilance required just for a particular circumstance and seems to be convenient or time-intensive.

What are 3 tools you would use to make the spreadsheet look nicer? Explain what
it does and how you would use.

Answers

Answer:

Add-Ons, Add-Ins and use Excel

Explanation:

Add-Ons, Add-Ins and Excel use to make the spreadsheet look nicer, the spreadsheet uses these tools to enhance work speed.

Spreadsheet and tools:

In just a few clicks, you can add reports, statistics, data analysis, and even emailing schedule tools to your spreadsheets using the Sheets Add-ons Gallery.

An add-in is a piece of software that extends the functionality of Microsoft Excel. Add-ons let you save time.

Workbooks are the name given to Excel documents. Sheets, often known as spreadsheets, are included in each workbook.

Find out more information about 'Spreadsheet'.

https://brainly.com/question/26079895?referrer=searchResults

The process of editing includes which of the following?
(A) Transferring photos to a computer
(B) Combining media
(C) Naming Files
(D) Keeping files secure

Answers

The answer should be

(B) combining media

PLEASE HELP IM GIVING BRAINLIEST!!

Create properly formatted works cited page for a research paper about the dangers of cell phone use on the road. Follow the MLA citation format, and make sure to correctly italicize each citation. For the purpose of this activity, it is not necessary to observe the MLA rules for indentation. Use the six sources provided to support the research paper.

Answers

Answer:

Cell phone use causes traffic crashes because a driver's cognitive performance significantly decreases when they are using a cell phone. Texting is also dangerous because the driver is taking their eyes away from the road and their hands away from the wheel. Driving demands a high level of concentration and attention.

Explanation:

PLz brainlyest

Ava is at her first job interview, and the interviewer asks her a difficult question she hasn't prepared to answer. What should Ava do?

Helpppp!!!!! im giving Brainliest

Answers

Answers: It's A. Or C. sorry that the best i got

Explanation:

Answer:

Take a deep breath and gather her thoughts.

Explanation:

Just took it and got full marks

Other Questions
Angle C and angle D are complementary. The measure of angle C is (2x) and the measure of angle D is (3x). Determine the value of x and the measure of the two angles.The two angles are C= 36 D= 54 So what is variable x? If Supreme Court Justice Elena Kagan votes with the majority of Supreme Court justiceson a particular case, yet her reasoning differs from the others, she may choose to expressher reasons in a The law of conservation of energy states that energy cannon be created or destroyed. O True O False What does the narrator argue about with his aunts and uncles at the end of the story? the school choir has 110 members there are 20 more girls than boys there are how many boys the choir If Nina is N years old now and Maryna is M years old now. Write Maryna's age in 4 years? Scott and Letitia are brother and sister. After dinner, they have to do the dishes, with one washing and the other drying. They are having trouble deciding who will do what task, so they came up with a method based on probability. Letitia grabs some spoons and puts the is a bag. Some have purple handles and others have green handles. Scott has to pick two of the spoons. If their handles are the same, Scott will wash. If they are different colors, he will dry. It turns out there are two purple spoons and three green ones. What is the probability of Scott washing the dishes? i need help on all these Select all that apply. Which numbers are not perfect squares? 36 14 20 16 25 18 24 Is Tesla French, American, German, or Russian? How did the Maya contribute to the field of mathematics? A pencil holder in the shape of a cylinder has the dimensions shown in the diagram 20. Which of the following is the closest to the volume of the cylinder, in cubio H 907 cm F 209 cm G 3,627 cm 4,773 cm Pump B alone fills a tank in 9 hours. Pump C takes 15 hours to fill the same tank alone. If pumps A, B and C are used, the tank fills in 5 hours. How long does it take pump A to fill the the tank alone? Pls helpppp me and thank youuu Pudding has 120 calories in 2 ounces. How many calories are in 8 ounces of the pudding? A Customer Telephone Center receives 1,200 calls in a 24-hour period. Of these calls, 75% occur between 9:30 a.m. and 3:30 p.m., and calls are evenly distributed during this time. If each person handles 10 calls an hour, how many people are needed to handle calls during these hours Which statement about cells is false?a)Different cells work together to form tissues and organs.b)Cells are the basic structure of living things.c)New cells contribute to growth and repair.d)Cells contribute only to the reproduction of an organism. Find the value of x in the picture below(round to nearest test) The Hessians, German mercenaries, were listed as one of the reason the colonists wanted independence from England. Trueor False Had more than 50 independent city-states A. MayaB. AztecC. Inca