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

Yahtzee in JAVA! **Yahtzee class: main( ) method is updated and does the followi

ID: 3751394 • Letter: Y

Question

Yahtzee in JAVA!

**Yahtzee class: main( ) method is updated and does the following:

1. Call static method System.out.println( ) output to the console “Welcome to Yahtzee!”

2. Call static method JOptionPane.showMessageDialog( ) using the method signature that receives two arguments; the first argument should be null, the second argument should be explicit text “Let’s Play Yahtzee!”

**constants package created:

Constants.java: class Constants is created including these constants:

public final static int MAX_YAHTZEE = 4;

public final static int NUM_DICE = 5;

public final static int MAX_DIE_VALUE = 6;

public final static int>

public final static int TWOS = 2;

public final static int THREES = 3;

public final static int FOURS = 4;

public final static int FIVES = 5;

public final static int SIXES = 6;

public final static int THREE_KIND = 7;

public final static int FOUR_KIND = 8;

public final static int CHANCE = 9;

public final static int NUM_CATERGORY = 13;

public final static int FULL_HOUSE = 25;

public final static int SM_STRAIGHT = 30;

public final static int UPPER_BONUS = 35;

public final static int LG_STRAIGHT = 40;

public final static int YAHTZEE = 50;

public final static int YAHTZEE_BONUS = 100;

**core package created with the following:

AiPlayer.java: AiPlayer class created and extends class Player

1. Override the methods from the interface IPlayer:

-rollDice()

-selectCategory()

Die.java: Die class created

1. Add member variables below:

-faceValue (data type int)

2. Create getter/setter for the member variable

Game.java: Game class created

1. Add member variables below:

-gameTurn (data type int)

-players (data type ArrayList<Player>)

-dice (data type class Roll)

2. Create getter/setter for the member variables

HumanPlayer.java: HumanPlayer class created and extends class Player

1. Override the methods from the interface IPlayer:

-rollDice()

-selectCategory()

IPlayer.java: IPlayer interface created

1. Add method signatures so that the return type will be void and the parameter list is empty:

-rollDice

-selectCategory

LowerSection.java: LowerSection class created

1. Add member variables below:

-threeKind (data type int)

-fourKind (data type int)

-fullHouse (data type int)

-smStraight (data type int)

-lgStraight (data type int)

-yahtzee (data type int)

-chance (data type int)

-yahtzeeBonus (data type int)

-totalScore (data type int)

2. Create getter/setter for the member variables

Player.java: Player abstract class created and implements interface IPlayer

1. Add member variables below:

-name (data type String)

-score (data type ScoreCard)

2. Create getter/setter for the member variables

Roll.java: Roll class created

1. Add member variables below:

-dice (data type ArrayList<Die>)

2. Create getter/setter for the member variables

ScoreCard.java: ScoreCard class created

1. Add member variables below:

-upper (data type class UpperSection)

-lower (data type class LowerSection)

-grandTotal (data type int)

2. Create getter/setter for the member variables

UpperSection.java: UpperSection class created

1. Add member variables below:

-aces (data type int)

-twos (data type int)

-threes (data type int)

-fours (data type int)

-fives (data type int)

-sixes (data type int)

-totalScore (data type int)

-bonus (data type int)

-total (data type int)

2. Create getter/setter for the member variable

**userInterface package created

Explanation / Answer

Below are the classes as asked:

AiPlayer.java:

public class AiPlayer extends Player{

Die.java:

public class Die {

If you any doubt please let me know.