Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java: do commented \"to do\" projects commented in the class: import java.util.R

ID: 3597716 • Letter: J

Question

Java: do commented "to do" projects commented in the class:

import java.util.Random;

/**
* Player class for the game of Odd or Even
*
* @author: YOUR NAME
* @version: 10/14/2017
*/
public class Player
{
private String name;
private String guess;
private int points;

/**
* Constructor sets the name to the given playersName,
* guess is set to empty string, and points to 0
*
* @param playerName The player's name
*/
public Player(String playerName)
{
// TODO Project 2
this.name = playerName;
System.out.println("In Player constructor - IMPLEMENT ME");
}

/**
* The makeGuess method causes the player to guess either EVEN or ODD
* Creates a random object and utilizes nextBoolean method
*/
public void makeGuess()
{
// TODO Project 2
System.out.println("In makeGuess method - IMPLEMENT ME");
}

/**
* The addPoint method adds one point to the player's current balance
*/
public void addPoint()
{
// TODO Project 2
System.out.println("In addPoint method - IMPLEMENT ME");
}

/**
* Accessor method
*
* @return the player's name field
*/
public String getName()
{
// TODO Project 2
return "name ???"; // THIS IS A STUB
}

/**
* Accessor method
*
* @return the value of the guess field
*/
public String getGuess()
{
// TODO Project 2
return "guess ???"; // THIS IS A STUB
}

/**
* Accessor method
*
* @return the value of the points field
*/
public int getPoints()
{
// TODO Project 2
return 0; // THIS IS A STUB
}

/**
* @return the String representation of the content of the player's object:
* only players name and the numbers of points are given
*/
public String toString()
{
// TODO Project 2
return "toString ???"; // THIS IS A STUB
}
}

Explanation / Answer

import java.util.Random;

/**
* Player class for the game of Odd or Even
*
* @author: YOUR NAME
* @version: 10/14/2017
*/
public class Player
{
private String name;
private String guess;
private int points;

/**
* Constructor sets the name to the given playersName,
* guess is set to empty string, and points to 0
*
* @param playerName The player's name
*/
public Player(String playerName)
{
// TODO Project 2
this.name = playerName;
System.out.println("In Player constructor - IMPLEMENT ME");
}

/**
* The makeGuess method causes the player to guess either EVEN or ODD
* Creates a random object and utilizes nextBoolean method
*/
public void makeGuess()
{
// TODO Project 2
System.out.println("In makeGuess method - IMPLEMENT ME");
}

/**
* The addPoint method adds one point to the player's current balance
*/
public void addPoint()
{
// TODO Project 2
System.out.println("In addPoint method - IMPLEMENT ME");
}

/**
* Accessor method
*
* @return the player's name field
*/
public String getName()
{
// TODO Project 2
return "name ???"; // THIS IS A STUB
}

/**
* Accessor method
*
* @return the value of the guess field
*/
public String getGuess()
{
// TODO Project 2
return "guess ???"; // THIS IS A STUB
}

/**
* Accessor method
*
* @return the value of the points field
*/
public int getPoints()
{
// TODO Project 2
return 0; // THIS IS A STUB
}

/**
* @return the String representation of the content of the player's object:
* only players name and the numbers of points are given
*/
public String toString()
{
// TODO Project 2
return "toString ???"; // THIS IS A STUB
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote