Question: Need in Java For this Project, model the objects in the game. So, you will need a die class, a cup class (which will contain

Need in Java

For this Project, model the objects in the game. So, you will need a die class, a cup class (which will contain 5 die objects), a scorecard class, a player class (which will contain a scorecard object), and a driver class. In this modified version, you will have 2 players (names will be supplied by user after the program has started). To keep the logic simple, normally you get 13 turns (up to 3 dice rolls per turn) per game, so we will have 39 turns with 1 dice roll per turn. The player will decide where to the score roll, if at all, since you only get to score 13 of the 39 turns, the scorecard class will verify the rolled dice do meet the criteria for where the player selected to score the turn. If the rolled dice do not meet the criteria of where the player attempted to score, a friendly polite message should inform the player of their error. After 39 turns the program should print out both players scorecards and declare the winner!

How the dice are scored:

Ones - total of ones rolled

At the end of a player's three rolls, he may decide to place his score in ones. To do this, add up the total of the ones and write the total into this box.

Twos - total of twos rolled To score in twos at the end of your turn, add up the total of the twos and write the total into this box.

Threes - total of threes rolled If you decide to place your score in threes, add up the total of the threes and write the total into this box.

Fours - total of fours rolled If you decide to place your score in fours, add up the total of the fours and write the total into this box.

Fives - total of fives rolled If you decide to place your score in fives, add up the total of the fives and write the total into this box.

Sixes - total of sixes rolled If you decide to place your score in sixes, add up the total of the sixes and write the total into this box.

Bonus - 35 points automatic award for subtotal of 63 If the total of the ones, twos, threes, fours, fives and sixes is greater or equal to 63, then a bonus of 35 points is automatically awarded. 63 points is the equivalent of 3 ones, 3 twos, 3 threes, 3 fours, 3 fives and 3 sixes. However, if you score 4 sixes then of course, that would make obtaining the bonus much easier as you would not need so many points from the other numbers.

3-of-a-Kind - total of all dice rolled OR 0 If there are at least three dice rolled of the same number, then you can score the total sum of the dice in this box. If there are not at least three of the same number rolled, you may score 0 in this box.

4-of-a-Kind - total of all dice rolled OR 0 If there are at least four dice rolled of the same number, then you can score the total sum of the dice in this box. If there are not at least four of the same number rolled, you may score 0 in this box.

Full House - 3 of one kind and 2 of another - 25 points A full house is where you have three of one number and two of another number. This scores 25 points. Otherwise score 0. Example: 1, 4, 3, 3, 3 = 0 points. 4, 1, 1, 4, 4 = 25 points.

Low Straight - 30 points for four in a row. A low straight is any sequence that runs through four numbers and is worth 30 points. If you do not have a sequence that includes four consecutive numbers, then score 0.

High Straight - 40 points for five in a row. A high straight is any sequence that runs through five numbers and is worth 40 points. If you do not have a sequence that includes five consecutive numbers, then score 0.

Yahtzee - 50 points for five identical numbers. A yahtzee is where all five dice are the same and is worth 50 points! If you do not have five numbers the same, then score 0.

Chance - Chance is the total of all of the dice, no matter what was rolled.

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!