1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
skad [1K]
3 years ago
9

Create a TicTacToe class that initializes a 3x3 board of "-" values. We will use this class in future exercises to fully build o

ut a Tic Tac Toe game! The TicTacToe class should have a 2D array as an instance variable and a constructor that initializes the 2D array with the "-" value. Add a getter method that returns the private 2D instance variable.
Computers and Technology
1 answer:
kap26 [50]3 years ago
8 0

Answer:

public class TicTacToe //Defining TicTacToe class

{

char board[3][3] ; //Creating a 2D array instance variable

TicTacToe() //Constructor to initialize the array with " - "

{

for( int i = 0;i<3;i++) //Loop for the row of array

{

for(int j = 0;j<3;j++) //Loop for the column of array

{

Board[i][j] = '-'; //Assigning "-" in each cell

}

}

}

public char getter() //Defining getter() method to return the array

{

return Board; //returning the array

}

}

You might be interested in
the front desk of the Nocete's Hotel will comlute the total room sales (TRS) of Room 101.The room was occupied three times and t
Rus_ich [418]

Answer:

Php. 1050

Explanation:

Total Room sales for Room 101:

Rate = 350

Number of times occupied = 3

Total sales per room : (number of times room was occupied * rate of the room.)

Hence, total sales for room 101:

Php. 350 * 3

= Php. 1050

4 0
2 years ago
Define a function that will return the length of a list
Alexus [3.1K]

Answer:

len()function:

Explanation:

that's for python btw

i also know java if you want a java version

3 0
2 years ago
Short note about micro miniaturzation​
Ghella [55]

Answer:

the manufacture of extremely small versions of electronic devices.

3 0
2 years ago
Read 2 more answers
How will you apply what you have learned in our topic today in a real life situation? Show your answers in the acronyms provided
alexira [117]
It means get in the kitchen woman that’s what cookery means
8 0
3 years ago
What will you better be prepared for by learning about the animals you photograph
krek1111 [17]

D. All of the above.

Makes the most sense! :3

6 0
2 years ago
Other questions:
  • to the nearest millimeter a cell phone is 123 long and 54 mm wide what is the ratio of width to length
    12·1 answer
  • How are engineers are related to technology
    13·1 answer
  • A server that provides data transfer and storage space at remote locations is called a
    7·1 answer
  • Put these steps for managing your study time in chronological order. 1 set aside the same time each day 2 Identify the best time
    14·1 answer
  • The syntax for accessing a class (struct) member using the operator -&gt; is ____.
    15·2 answers
  • The elements in a long array of integers are roughly sorted in decreasing order. No more than 5 percent of the elements are out
    12·1 answer
  • Do you think it’s better for a young designer to use free, open-source art programs or to pay for commercial programs? Explain y
    14·1 answer
  • An analogue sensor has a bandwidth which extends from very low frequencies up to a maximum of 14.5 kHz. Using the Sampling Theor
    9·2 answers
  • What is speaker?.....​
    13·1 answer
  • A Python file that contains variables and functions and can be used in other programs is called a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!