Question: Creating a Yahtzee program - Java Help! Core package: Execute the requirements in each class - excluding Yahtzee class and Constants class - each class

Creating a Yahtzee program - Java Help! Core package: Execute the requirements in each class - excluding Yahtzee class and Constants class - each class and package has been created.

Yahtzee class

main() method:

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

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 Lets Play Yahtzee!

constants package

Created

Constants.java

Created/includes:

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 ONES = 1;

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

AiPlayer.java

Created: Class AiPlayer extends class Player

Override methods from interface IPlayer

1. rollDice()

2. selectCategory()

Die.java

Created: Class Die

Add member variables

1. faceValue, data type int

Create getter/setter for member variable

Game.java

Created: Class Game

Add member variables

1. gameTurn, data type int

2. players, datatype ArrayList

3. dice, datatype class Roll

Create getter/setter for member variables

HumanPlayer.java

Created: Class HumanPlayer extends class Player

Override methods from interface IPlayer

1. rollDice()

2. selectCategory()

IPlayer.java

Created: Interface IPlayer

Add method signatures so that the return type is void and the parameter list is empty

1. rollDice

2. selectCategory

LowerSection.java

Created: Class LowerSection

Add member variables

1. threeKind, data type int

2. fourKind, data type int

3. fullHouse, data type int

4. smStraight, data type int

5. lgStraight, data type int

6 yahtzee, data type int

7. chance, data type int

8. yahtzeeBonus, data type int

9. totalScore, data type int

Create getter/setter for member variables

Player.java

Created: Abstract class Player implements interface IPlayer

Add member variables

1. name, data type String

2. score, data type ScoreCard

Create getter/setter for member variables

Roll.java

Created: Class Roll

Add member variables

1. dice, data type ArrayList

Create getter/setter for member variables

ScoreCard.java

Created: Class ScoreCard

Add member variables

1. upper, data type class UppserSection

2. lower, data type class LowerSection

3. grandTotal, data type int

Create getter/setter for member variables

UpperSection.java

Created: Class UpperSection

Add member variables

1. aces, data type int

2. twos, data type int

3. threes, data type int

4. fours, data type int

5. fives, data type int

6. sixes, data type int

7. totalScore, data type int

8. bonus, data type int

9. total, data type int

Create getter/setter for member variables

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!