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. Could you also add comments to each line of code when you write out the codes for this as welI? 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:
public static void displayScoreSheet() {
final String ACES_LABEL = "Aces";
final String TWOS_LABEL = "Twos";
final String THREES_LABEL = "Threes";
final String FOURS_LABEL = "Fours";
final String FIVES_LABEL = "Fives";
final String SIXES_LABEL = "Sixes";
final String THREE_KIND_LABEL = "3 of a kind";
final String FOUR_KIND_LABEL = "4 of a kind";
final String FULL_HOUSE_LABEL = "Full House";
final String SMALL_STRAIGHT_LABEL = "Sm. Straight";
final String LARGE_STRAIGHT_LABEL = "Lg. Straight";
final String YAHTZEE_LABEL = "YAHTZEE";
final String CHANCE_LABEL = "Chance";
final String YAHTZEE_BONUS_LABEL = "YAHTZEE BONUS";
final int BONUS_THRESHOLD = 63;
final int BONUS_SCORE = 35;
final String UPPER_SECTION_LABEL = "UPPER SECTION";
final String LOWER_SECTION_LABEL = "LOWER SECTION";
final String UPPER_SECTION_SUBTOTAL_LABEL = "TOTAL SCORE";
final String UPPER_SECTION_BONUS_LABEL = "BONUS if >= 63";
final String UPPER_SECTION_TOTAL_LABEL = "TOTAL of Upper Section";
final String LOWER_SECTION_TOTAL_LABEL = "TOTAL of Lower Section";
final String GRAND_TOTAL_LABEL = "GRAND TOTAL";
final String OPTION_SUFFIX_ONE_DIGIT = ") ";
final String OPTION_SUFFIX_TWO_DIGIT = ") ";
final String FIRST_OPTION_LABEL = "1";
final String SECOND_OPTION_LABEL = "2";
final String THIRD_OPTION_LABEL = "3";
final String FOURTH_OPTION_LABEL = "4";
final String FIFTH_OPTION_LABEL = "5";
final String SIXTH_OPTION_LABEL = "6";
final String SEVENTH_OPTION_LABEL = "7";
final String EIGHTH_OPTION_LABEL = "8";
final String NINTH_OPTION_LABEL = "9";
final String TENTH_OPTION_LABEL = "10";
final String ELEVENTH_OPTION_LABEL = "11";
final String TWELFTH_OPTION_LABEL = "12";
final String THIRTEENTH_OPTION_LABEL = "13";
final String EQUALS_LABEL = " = ";
//***
//*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE
//***
//*** 1) Declare a variable named "upperScoreTotal" of int datatype.
//***
//*** 2) Call method "calculateUpperScore" passing no arguments, assigning
//*** this method call to variable "upperScoreTotal".
//***
//*** 3) Declare a variable named "lowerScoreTotal" of int datatype.
//***
//*** 4) Call method "calculateLowerScore" passing no arguments, assigning
//*** this method call to variable "lowerScoreTotal".
//***
//***
//*** Your code for Steps 1-4 goes here.
//***
System.out.println();
System.out.println(UPPER_SECTION_LABEL);
if (aces == SCORE_NO_VALUE)
System.out.println(FIRST_OPTION_LABEL + OPTION_SUFFIX_ONE_DIGIT + ACES_LABEL);
else
System.out.println(FIRST_OPTION_LABEL + OPTION_SUFFIX_ONE_DIGIT + ACES_LABEL + EQUALS_LABEL + aces);
//***
//*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE
//***
//*** 1) Following the form of the if-statement-block for option Aces (lines 667-671):
//*** A) Write an if-statement-block for each of following variables
//*** that check the variables for "equality to" SCORE_NO_VALUE:
//*** a) "twos"
//*** b) "threes"
//*** c) "fours"
//*** d) "fives"
//*** e) "sixes"
//*** * In other words, there will be five (5) if-statement-blocks, each one
//*** must compare one of the listed variables to SCORE_NO_VALUE.
//*** B) Use the correct Java syntax for the "equality" operator.
//***
//*** NOTE: 1) Don't forget to use the different OPTION_LABEL constants when
//*** writing the code for Step 1.
//*** 2) Comment your code following the comment given for Aces. Include
//*** the option number and option name.
//***
//***
//*** Your code for Step 1 goes here.
//***
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- I need help with the content on the image below. The Code is Java.arrow_forwardNOTE: Please do not copy from another person's answer, if you do so, you will be given down vote/thumb down. Thank you! Also, No entire code is needed. Just provide the method for LList class in Java ------------------------------------------------------------------------------------------------------------------------------------------------------- Suppose that a list contains Comparable objects. Implement a method that returns a new list of items that are less than some given item. The header of the method could be as follows: public LList<T> getAllLessThan( Comparable<T> anObject) Write an implementation of this method for the class LList. Make sure that your method does not affect the state of the original list.arrow_forwardI didn't understand the previous code and it didn't run to my software . can you do it again? I use intelliJ IDE to code in JAVA. Thank youarrow_forward
- I was asked to add the three types of comments to this class, each consisting of the same statement (this statement is also printed once). The output/print, block comment, and single line comment has all been marked correct. The Javadoc comment, however, has not. I asked this question earlier and tried implementing that solution, however, it did not work. What should I do to make it work?arrow_forwardGrey lines of code can NOT be edited. NEW JAVA code inbetween lines 11 - 14 in photo. TIP:arrow_forwardPlease write in java. Add comments but make the comments short. No need for really long comments. Please keep code very neat and simple , dont add anything unneccesary in the code if you weren't instructed to do so. If youve answered this before please dont copy and paste from a previous question! (Rewrite it in another way)..... Also be sure to read the instructions below carefully. The Instructions attached below will explain everything you'll be doing. NO THIS is not a homework assignment, it's practice work. Please type the code out so that I can copy and paste it into my IDE and see the output for my self but also still provide a screenshot of your output!arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education