**Help: Creating a Yahtzee project in JAVA ** *Yahtzee class: Update the main( )
ID: 3747354 • Letter: #
Question
**Help: Creating a Yahtzee project in JAVA**
*Yahtzee class: Update the 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 “Let’s Play Yahtzee!”
(----constants package: package constants created
--------Constants.java: class Constants created)
Include the following constants in the Constants class:
int MAX_YAHTZEE = 4;
int NUM_DICE = 5;
int MAX_DIE_VALUE = 6;
int>
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;
Explanation / Answer
import javax.swing.*; public class Yahtzee { public static void main(String[] args) { System.out.println("Welcome to Yahtzee!"); JOptionPane.showMessageDialog(null,"Let’s Play Yahtzee!" ); } } public class 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; }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.