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 calculateFourOfKind() { int score; score = 0; boolean isFourKind; isFourKind = false; System.out.println("In method calculateFourOfKind"); return score; //*** //*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE //*** //*** Modify your "calculateFourOfKind" 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 four-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. //*** //***    3) In your if-else-if structure, if it is determined that the configuration of the dice form a valid          //***        four-of-a-kind, then assign the value of true to the variable "isFourKind". //*** //***    4) Write an if-statement that checks if variable "isFourKind" 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 that form a valid four-of-a-kind: //***          1) Variables "die1", "die2", "die3" and "die4" are equal //***          2) Variables "die1", "die2", "die3" and "die5" are equal //***          3) Variables "die1", "die2", "die4" and "die5" are equal //***          4) Variables "die1", "die3", "die4" and "die5" are equal //***          5) Variables "die2", "die3", "die4" and "die5" are equal //***

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
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 calculateFourOfKind() {

int score;

score = 0;

boolean isFourKind;

isFourKind = false;

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

return score;

//***
//*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE
//***
//*** Modify your "calculateFourOfKind" 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 four-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.
//***
//***    3) In your if-else-if structure, if it is determined that the configuration of the dice form a valid          //***        four-of-a-kind, then assign the value of true to the variable "isFourKind".
//***
//***    4) Write an if-statement that checks if variable "isFourKind" 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 that form a valid four-of-a-kind:
//***          1) Variables "die1", "die2", "die3" and "die4" are equal
//***          2) Variables "die1", "die2", "die3" and "die5" are equal
//***          3) Variables "die1", "die2", "die4" and "die5" are equal
//***          4) Variables "die1", "die3", "die4" and "die5" are equal
//***          5) Variables "die2", "die3", "die4" and "die5" are equal
//***

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY