Hello! I am having trouble on how to write out the Java code based on the instructions (in bold //***) that I am given. As a note, this specific Java code is a code that is going to setup the basic framework for a game of Yahtzee. In other words, you will need to understand the rules of Yahtzee and implement the rules into coding. I appreciate the help. Thanks! Also, I am using the IntelliJ IDEA application when writing out this program. Here is what I need help with: * The code given below is going to be modified based on the instructions in bold. // These are the declared die values. static int die1, die2, die3, die4, die5; public static int calculateFullHouse() { int score; score = 0; boolean isFullHouse; isFullHouse = false; System.out.println("In method calculateFullHouse"); return score; } //*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE //*** //*** Modify your "calculateFullHouse" method as follows: //***    1) Remove the System.out.println statement. //*** //***    2) Write an if-statement that checks if the player has Yahtzee. //***        NOTE: Yahtzee is not a Full House. //***        A) Consider the definition of a Full House, which is: //***             "Three of one number and two of a different number" //***        B) The if-statement condition for Step 2 must call method //***             "calculateYahtzee" and check for "equality to" 0 (zero). //*** //***    3) Inside the if-statement in Step 2, nest the following: //***        A) Create an if-else-if structure to determine if the five (5) //***             dice form a valid Full House. //***        B) You MUST use an if-else-if structure. //***        C) Your if-statement conditions MUST be compound Boolean expressions. //***             In other words, the if-statement conditions must have multiple //***             expressions joined by && (AND) or || (OR) operators. //*** //***    4) In your if-else-if structure, if it is determined that the //***        configuration of the dice form a valid Full House, then assign //***        the value of true to the variable "isFullHouse". //*** //***    5) Not connected to nor nested within the if-statement in Step 2, //***        write an if-statement that checks if variable "isFullHouse" is true. //*** //***    6) Code block for if-statement in Step 5: //***        A) Assign the value of FULL_HOUSE_SCORE to variable "score". //*** //***    7) Keep the return statement that returns the variable "score". //*** //***    Hint: Here are the combinations of dice that form a valid Full House: //***          1) Variables "die1", "die2" and "die3" are equal, and variables "die4" and "die5" are equal //***          2) Variables "die2", "die3" and "die4" are equal, and variables "die1" and "die5" are equal //***          3) Variables "die3", "die4" and "die5" are equal, and variables "die1" and "die2" are equal //***          4) Variables "die1", "die3" and "die5" are equal, and variables "die2" and "die4" are equal //***          5) Variables "die1", "die3" and "die4" are equal, and variables "die2" and "die5" are equal //***          6) Variables "die1", "die4" and "die5" are equal, and variables "die2" and "die3" are equal //***          7) Variables "die1", "die2" and "die4" are equal, and variables "die3" and "die5" are equal //***          8) Variables "die1", "die2" and "die5" are equal, and variables "die3" and "die4" are equal //***          9) Variables "die2", "die3" and "die5" are equal, and variables "die1" and "die4" are equal //***        10) Variables "die2", "die4" and "die5" are equal, and variables "die1" and "die3" are equal

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello! I am having trouble on how to write out the Java code based on the instructions (in bold //***) that I am given. As a note, this specific Java code is a code that is going to setup the basic framework for a game of Yahtzee. In other words, you will need to understand the rules of Yahtzee and implement the rules into coding. I appreciate the help. Thanks! Also, I am using the IntelliJ IDEA application when writing out this program. Here is what I need help with:

* The code given below is going to be modified based on the instructions in bold.

// These are the declared die values.
static int die1, die2, die3, die4, die5;

public static int calculateFullHouse() {

int score;

score = 0;

boolean isFullHouse;

isFullHouse = false;

System.out.println("In method calculateFullHouse");

return score;

}

//*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE
//***
//*** Modify your "calculateFullHouse" method as follows:
//***    1) Remove the System.out.println statement.
//***
//***    2) Write an if-statement that checks if the player has Yahtzee.
//***        NOTE: Yahtzee is not a Full House.
//***        A) Consider the definition of a Full House, which is:
//***             "Three of one number and two of a different number"
//***        B) The if-statement condition for Step 2 must call method
//***             "calculateYahtzee" and check for "equality to" 0 (zero).
//***
//***    3) Inside the if-statement in Step 2, nest the following:
//***        A) Create an if-else-if structure to determine if the five (5)
//***             dice form a valid Full House.
//***        B) You MUST use an if-else-if structure.
//***        C) Your if-statement conditions MUST be compound Boolean expressions.
//***             In other words, the if-statement conditions must have multiple
//***             expressions joined by && (AND) or || (OR) operators.
//***
//***    4) In your if-else-if structure, if it is determined that the
//***        configuration of the dice form a valid Full House, then assign
//***        the value of true to the variable "isFullHouse".
//***
//***    5) Not connected to nor nested within the if-statement in Step 2,
//***        write an if-statement that checks if variable "isFullHouse" is true.
//***
//***    6) Code block for if-statement in Step 5:
//***        A) Assign the value of FULL_HOUSE_SCORE to variable "score".
//***
//***    7) Keep the return statement that returns the variable "score".
//***
//***    Hint: Here are the combinations of dice that form a valid Full House:
//***          1) Variables "die1", "die2" and "die3" are equal, and variables "die4" and "die5" are equal
//***          2) Variables "die2", "die3" and "die4" are equal, and variables "die1" and "die5" are equal
//***          3) Variables "die3", "die4" and "die5" are equal, and variables "die1" and "die2" are equal
//***          4) Variables "die1", "die3" and "die5" are equal, and variables "die2" and "die4" are equal
//***          5) Variables "die1", "die3" and "die4" are equal, and variables "die2" and "die5" are equal
//***          6) Variables "die1", "die4" and "die5" are equal, and variables "die2" and "die3" are equal
//***          7) Variables "die1", "die2" and "die4" are equal, and variables "die3" and "die5" are equal
//***          8) Variables "die1", "die2" and "die5" are equal, and variables "die3" and "die4" are equal
//***          9) Variables "die2", "die3" and "die5" are equal, and variables "die1" and "die4" are equal
//***        10) Variables "die2", "die4" and "die5" are equal, and variables "die1" and "die3" are equal

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education