Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PART 1: Already completed. Need Part 2 Yahtzee project Create a new Java Application project named Yahtzee allowing Netbeans IDE to create the main class

PART 1: Already completed. Need Part 2

Yahtzee project

Create a new Java Application project named Yahtzee

allowing Netbeans IDE to create the main class called Yahtzee

Yahtzee class

Update main() method to do 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

Create package constants

Constants.java

Create class Constants

// Constants are declared so that:

their access level modifier is public

to ensure they cannot be modified they are final

to allow access without instantiating an instance of the class they are static

Include constants:

int MAX_YAHTZEE = 4;

int NUM_DICE = 5;

int MAX_DIE_VALUE = 6;

int ONES = 1;

int TWOS = 2;

int THREES = 3;

int FOURS = 4;

int FIVES = 5;

int SIXES = 6;

int THREE_KIND = 7;

int FOUR_KIND = 8;

int CHANCE = 9;

int NUM_CATERGORY = 13;

int FULL_HOUSE = 25;

int SM_STRAIGHT = 30;

int UPPER_BONUS = 35;

int LG_STRAIGHT = 40;

int YAHTZEE = 50;

int YAHTZEE_BONUS = 100;

core package

Create package core

AiPlayer.java

Create class AiPlayer so that it extends class Player

Die.java

Create class Die

Game.java

Create class Game

HumanPlayer.java

Create class HumanPlayer so that it extends class Player

IPlayer.java

Create interface IPlayer

LowerSection.java

Create class LowerSection

Player.java

Create abstract class Player so that it implements interface IPlayer

Roll.java

Create class Roll

ScoreCard.java

Create class ScoreCard

UpperSection.java

Create class UpperSection

userInterface package

Create package userInterface

PART 2:

Yahtzee class

AiPlayer class

Override methods from interface IPlayer

rollDice()

selectCategory()

Die class

Add member variables

faceValue, data type int

Create getter/setter for member variable

Game class

Add member variables:

gameTurn, data type int

players, datatype ArrayList

dice, datatype class Roll

Create getter/setter for member variables

HumanPlayer class

Override methods from interface IPlayer

rollDice()

selectCategory()

IPlayer interface

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

rollDice

selectCategory

LowerSection class

Add member variables

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 member variables

Player class

Add member variables

name, data type String

score, data type ScoreCard

Create getter/setter for member variables

Roll class

Add member variables

dice, data type ArrayList

Create getter/setter for member variables

ScoreCard class

Add member variables

upper, data type class UppserSection

lower, data type class LowerSection

grandTotal, data type int

Create getter/setter for member variables

UpperSection class

Add member variables

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 member variables

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

More Books

Students also viewed these Databases questions

Question

=+management system of the MNE?

Answered: 1 week ago