zyBooks Intro to Java Program #2 Help - Computer Science
6.19 Program #2: Poker dice game Program Specifications Write a program to calculate the score from a throw of five dice. Scores are assigned to different categories for singles, three of a kind, four of a kind, five of a kind, full house, and straight. Follow each step to gradually complete all methods. Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. Step 0. Review the provided main() method. Five integer values are input and inserted into an array. The array is sorted and passed to findHighScore() to determine the highest scoring category. Make no changes to main(). Stubs are provided for all remaining methods. Step 1 (3 pts). Complete the checkSingles() method. Return the sum of all values that match parameter goal. Update the findHighScore() method to use a loop to call checkSingles() six times with parameters of 1 - 6. Return the highest score from all method calls. Submit for grading to confirm two tests pass. Ex: If input is: 2 4 1 5 4 the output is: High score: 8 Step 2 (3 pts). Complete the checkThreeOfKind(), checkFourOfKind(), and checkFiveOfKind() methods. Hint: Since the values are in ascending order, same values are stored in consecutive index locations. Return 30 from checkThreeOfKind() if the dice contain at least three of the same values. Ex: (2, 3, 3, 3, 6). Return 40 from checkFourOfKind() if the dice contain at least four of the same values. Ex: (4, 4, 4, 4, 5). Return 50 from checkFiveOfKind() if the dice contain five identical values. Ex: (5, 5, 5, 5, 5). Update the findHighScore() method to call the three methods and return the highest score from all method calls. Submit for grading to confirm five tests pass. Ex: If input is: 2 4 4 5 4 the output is: High score: 30 Step 3 (2 pts). Complete the checkFullHouse() method to return 35 if the dice contain a full house (a pair and three of a kind). Ex: (1, 1, 3, 3, 3). Note: Five of a kind also satisfies the definition of a full house since (4, 4, 4, 4, 4) includes a pair of 4s and three 4s. Update the findHighScore() method to call checkFullHouse() and return the highest score from all method calls. Submit for grading to confirm seven tests pass. Step 4 (2 pts). Complete the checkStraight() method to return 45 if the dice contain a straight of (1, 2, 3, 4, 5) or (2, 3, 4, 5, 6). Update the findHighScore() method to call checkStraight() and return the highest score from all method calls. Submit for grading to confirm all tests pass. I need help making this code, I could only do checkSingles(). Please help.
CATEGORIES
Precalculus Social Science Computer Science Education Architecture and Design Nursing Marketing Mathematics Psychology History Management Human Resource Management Business & Finance Accounting Electronic Engineering World history Applied Sciences Information Systems Criminal Biology Economics Civil Operations Management Reading Chemistry Government Geography Anatomy Sociology Telecommunications Engineering Physics English Pharmacology Political Science American history Statistics Science Financial markets Law It is understood that higher moral reasoners have an established determination of right or wrong based on their morals and sense of social obligation (Lyon & Welsh Philosophy Literature Civil Engineering In 2 to 3 paragraphs Environmental science Ecology Physiology Algebra The patient feels excess confidence and exhilaration evident in how he answers the doctor confidently explaining that his health problems are so numerous that he can be used to teach a whole health encyclopedia. The opioid drugs are mainly used to relieve Electrical Engineering Geology Physical chemistry I would perform assessments targeting substance abuse severity Ancient history 2 This Template is organized into three primary parts: Part I Mechanical Engineering Thomas Gaul had worked hard to become one of the youngest partners of one of the leading consulting firms in the US. When the company received an invitation from a Mexican firm to make a company presentation for them The company has been in business for more than 50 years and in this time has collected vast amounts of data. Much of this data has been stored in hard copy format in filing cabinets at an offsite location but in recent times What is the reason he started to take pain medication Engineering 1 Enter into the Template exactly 10 strengths and 10 weaknesses Numerical analysis Organic chemistry gement The patient must be having chronic disease especially cancer that requires him to use opioid-based drugs as painkillers which have resulted in his addiction due to continuous usage. The patient also has high blood pressure and diabetes. He uses multiple d Calculus This is an academic Spanish Ray is 22 years old and unemployed. He lives in his mother’s basement just outside Fort Lauderdale and safety outcomes Given what has been learned Joe presents with the following symptoms Chemical Engineering Electromagnetism Writing Business Finance Health Medical Humanities Programming Other Foreign Languages Communications In the “Gender Queer: A Memoir” comic Trigonometry Write your introduction to this 6 page paper here. Include one paragraph (not more than 6 lines of text) that explains what your paper will discuss. Much of your introduction may be taken from the assignment instructions (in your own words). Read all assi Some examples are given below Bellevue Hospital is a large healthcare organization that provides many opportunities for everyone within the area that has private insurance state Medicaid I believe that a program that is created to preserve fertility for children who have survived cancer be created classmate’s post : response should be based on this post (In the piece Desirees Baby Probability We work Geometry Article writing The issue of death punishment is contentious. The death penalty endangers both life and personal liberty. The dignity of those participating in a debate should be preserved. Its an embarrassing manner of execution that also shows bias. The mentally ill The establishment for building and keeping up with all information bases is DBMS. Getting to a data set where all the data is kept can represent a serious danger to the business Reference and discuss any professional code of ethics relevant to your topic such as the AMA code for doctors The classes that I attended during this stage reinforced my ideas and problem-solving approaches since they were not narrowed to business alone The Linux working framework family is a gathering of open-source My previous education career has been successful Mechanics Figuring out is the most common way of deciding an items plan I advance my learning not only for academic achievement but to boost my career life and to achieve my career goals within a given time frame. The research that I have conducted over my past education’s history could be more than enough for someone else The death penalty is ineffective as a deterrent against future criminal behavior since it is neither necessary nor likely to prevent future criminal activity. The death penalty is not the only form of effective punishment; incarceration and monetary repar e College is based in Sydney CBD and has an additional campus in Melbourne. The College offers a range of courses in management The investigation of and utilization of techniques for secret correspondence within the sight of outside enemies is known as cryptography. It requires planning and surveying techniques that prevent evil outsiders from setting data sent between two substan Mr. Perkins