Question: Need Help with this JAVA multi-part Question, (2D matrices class and TicTacToe class together): Key pointers: (1) Make sure that if I want to extend
Need Help with this JAVA multi-part Question, (2D matrices class and TicTacToe class together):
Key pointers:
(1) Make sure that if I want to extend the program to larger grids, you just need to change the
size of the grids. You should not change anything else in the program.
(2) If I want to change the interface, I should not change anything in the module that
implements the logic of the game.


Exercise 2 - Object Oriented Programming Concepts Write a Java class called Matrix, which implements the data structure necessary for manipulating 2D matrices. Write the getter and setter functions which allow accessing the elements of the matrix. Exerdse 3 (This exerdse is assessed) Tic-Tac-Toe In this exercise, you are going to program the Tic-Tac-Toegame (see Figure 1.1) using Java. DO NOT start this exercise before finishing exercise 2. Page 1 ICT 376 - Mobile Applications Development 29 Tic Tac Toe O's Turn Note: you are not required to develop the graphical interface - input from the command line is sufficient For those who are not familiar with the game: Tic-tac-toe (also known as noughts and crosses or Xs and Os) is a paper-and-pencil game for two players, X and 0, who take turns marking the spaces in a 3x3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row wins the game. (source: Wikipedia). Assume that we have a grid of size 3x3. Each cell in the grid is identified by its row number and its column number. At the start of the game, the grid is empty. X There are two players, A and B. Player A will play first. 0 Write a program which: (1) At the start of the game, it displays the grid as follows: Figure 1.1. Tic-Tac-Toe interface Player A: (2) Player Athen enters the coordinates of the cell he wants to tic, e.g., Player A: 13 (3) The system then displays the updated grid, and gives hand to player B to play: Player B: (4) Player B then in puts the grid cell he wants to tick, e.g., Player B: 21 (5) The system then updates the grid, displays the updated grid, and gives hand to player A: --X 0-. Player A: (6) Repeat until there is a winner. Page 12 ICT 376 - Mobile Applications Development You are asked to implement this program. In your solution, make sure you follow the good programming practices: (1) Make sure that if I want to extend the program to larger grids, you just need to change the size of the grids. You should not change anything else in the program. (2) If I want to change the interface, I should not change anything in the module that implements the logic of the game
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
