Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 Lets 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 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 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)

-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)

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

Students also viewed these Databases questions

Question

Heat and mass balance of IKN cooler ?

Answered: 1 week ago