Question
Creating a Yahtzee project in JAVA! **Yahtzee class: main( ) method is updated and does the following: -Call static method System.out.println( ) output to the
Creating a Yahtzee project in JAVA!
**Yahtzee class: main( ) method is updated and does the following:
-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: class Constants is created with the following constants in it:
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 and includes the following:
AiPlayer.java: AiPlayer class created and extends class Player
Override the methods from the interface IPlayer:
-rollDice()
-selectCategory()
Die.java: Die class created
Add member variables below:
-faceValue (data type int)
Create getter/setter for the member variable
Game.java: Game class created
Add member variables below:
-gameTurn (data type int)
-players (data type ArrayList
-dice (data type class Roll)
Create getter/setter for the member variables
HumanPlayer.java: HumanPlayer class created and extends class Player
Override the methods from the interface IPlayer:
-rollDice()
-selectCategory()
IPlayer.java: IPlayer interface created
Add method signatures so that the return type will be void and the parameter list is empty:
-rollDice
-selectCategory
LowerSection.java: LowerSection class created
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)
Create getter/setter for the member variables
Player.java: Player abstract class created and implements interface IPlayer
Add member variables below:
-name (data type String)
-score (data type ScoreCard)
Create getter/setter for the member variables
Roll.java: Roll class created
Add member variables below:
-dice (data type ArrayList
Create getter/setter for the member variables
ScoreCard.java: ScoreCard class created
Add member variables below:
-upper (data type class UpperSection)
-lower (data type class LowerSection)
-grandTotal (data type int)
Create getter/setter for the member variables
UpperSection.java: UpperSection class created
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)
Create getter/setter for the member variables
**userInterface package created
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started