For this last project, you must implement two Java classes. One will be a Player'' class, which
Question:
For this last project, you must implement two Java classes. One will be a "Player'' class, which will "simulate" a game player profile, and the other will be a -driver program which allows two players to play the game Tic Tac Toe. Your starting point for this project will be to start a NetBeans Project named Project$. In the NetBeans New Project window, change the name of the source package from project 6 to tictactoegame, and the name of the main class from Project6 to TicTacToeGame. Once you've started the project, download and save the Board.java class I've uploaded to Canvas into your project's tictactoegame source package. Phase I: Implement the Player Class (10 points) Next, add a new Java Class to the tictactoegame source package. Make sure the class is named Player. In this Player class, declare all of the data fields and write all of the methods described in the UML diagram below:
The Java class definition that you write must implement all of the data fields (variables) and behaviors (methods) shown in the above UML class diagram. Therefore, the class you write must contain all of the following global variables, constants and methods:
Variable and constants
? A private String-type variable named name - this will represent a player's name ? A private char-type variable named mark - this will represent the player's mark (X or O) on , Tic Tac Toe board. ? Two prince int- type variables named wins and losses, which will be used to count the player's wins and losses.
Constructors ? A no-erg constructor which takes no arguments. This constructor is responsible for setting the object's name variable to a default value of ?J Doe' and setting the wins and losses variables to a default value of 0. ? AU of the constructor overloads shown in the UMl diagram above.
Public interface methods
? set Name - A method which takes one String argument and stores that argument in a Suing-type parameter named newNamt This method is responsible for setting the object's name variable to the given Newname This method should return void ? setiAlm - A method which takes one int argument and stores that argument in a int?type parameter named nowwins. This method is responsible for setting the Objects wins variable to the given newwins. This method should return void. ? sattosses - A method which takes one int argument and stores that argument in a int-type parameter named newlosses This method is responsible for setting the objects losses variable to the given newtosses. This method should return void. ? wins - A method which takes no parameters and simply increments the value of the object's wins variable by 1. This method should return void. ? loses - A method which takes no parameters and simply increments the value of the object's losses variable by 1. This method should return void. ? getName - A method which takes no arguments. This method is responsible for returning the value of the object's name variable. This method should return String.
Discrete and Combinatorial Mathematics An Applied Introduction
ISBN: 978-0201726343
5th edition
Authors: Ralph P. Grimaldi