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. public static int calculateThreeOfKind() {        int score;        score = 0;        boolean isThreeKind;        isThreeKind = false;        System.out.println("In method calculateThreeOfKind");        return score; } //*** //*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE //*** //*** Modify your "calculateThreeOfKind" method as follows: //***    1) Remove the System.out.println statement. //*** //***    2) Create an if-else-if structure to determine if the five (5) //***        dice form a valid three-of-a-kind. //***        A) You MUST use an if-else-if structure. //***        B) 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. //***        C) I see a number of valid design approaches so as long as the //***             above conditions are met, I leave the rest of the design //***             decisions to you. //*** //***    3) In your if-else-if structure, if it is determined that the //***        configuration of the dice form a valid three-of-a-kind, //***        then assign the value of true to the variable "isThreeKind". //*** //***    4) Write an if-statement that checks if variable "isThreeKind" is true. //*** //***    5) Code block for if-statement in Step 4: //***        A) Add the values of variables "die1", "die2", "die3", "die4", //***             and "die5" together and assign that value to variable "score". //*** //***    6) Keep the return statement that returns the variable "score". //*** //***    Hint: Here are the combinations of dice variables that form a valid three-of-a-kind: //***          1) Variables "die1", "die2" and "die3" are equal //***          2) Variables "die1", "die2" and "die4" are equal //***          3) Variables "die1", "die2" and "die5" are equal //***          4) Variables "die1", "die3" and "die4" are equal //***          5) Variables "die1", "die3" and "die5" are equal //***          6) Variables "die1", "die4" and "die5" are equal //***          7) Variables "die2", "die3" and "die4" are equal //***          8) Variables "die2", "die3" and "die5" are equal //***          9) Variables "die2", "die4" and "die5" are equal //***        10) Variables "die3", "die4" and "die5" 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.

public static int calculateThreeOfKind() {

       int score;

       score = 0;

       boolean isThreeKind;

       isThreeKind = false;

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

       return score;

}

//***
//*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE
//***
//*** Modify your "calculateThreeOfKind" method as follows:
//***    1) Remove the System.out.println statement.
//***
//***    2) Create an if-else-if structure to determine if the five (5)
//***        dice form a valid three-of-a-kind.
//***        A) You MUST use an if-else-if structure.
//***        B) 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.
//***        C) I see a number of valid design approaches so as long as the
//***             above conditions are met, I leave the rest of the design
//***             decisions to you.
//***
//***    3) In your if-else-if structure, if it is determined that the
//***        configuration of the dice form a valid three-of-a-kind,
//***        then assign the value of true to the variable "isThreeKind".
//***
//***    4) Write an if-statement that checks if variable "isThreeKind" is true.
//***
//***    5) Code block for if-statement in Step 4:
//***        A) Add the values of variables "die1", "die2", "die3", "die4",
//***             and "die5" together and assign that value to variable "score".
//***
//***    6) Keep the return statement that returns the variable "score".
//***
//***    Hint: Here are the combinations of dice variables that form a valid three-of-a-kind:
//***          1) Variables "die1", "die2" and "die3" are equal
//***          2) Variables "die1", "die2" and "die4" are equal
//***          3) Variables "die1", "die2" and "die5" are equal
//***          4) Variables "die1", "die3" and "die4" are equal
//***          5) Variables "die1", "die3" and "die5" are equal
//***          6) Variables "die1", "die4" and "die5" are equal
//***          7) Variables "die2", "die3" and "die4" are equal
//***          8) Variables "die2", "die3" and "die5" are equal
//***          9) Variables "die2", "die4" and "die5" are equal
//***        10) Variables "die3", "die4" and "die5" 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